src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

report.go (498B)


      1 package command
      2 
      3 import (
      4 	"fmt"
      5 	"time"
      6 
      7 	"code.dwrz.net/src/pkg/dqs/command/help"
      8 	"code.dwrz.net/src/pkg/dqs/report"
      9 	"code.dwrz.net/src/pkg/dqs/store"
     10 )
     11 
     12 var Report = &command{
     13 	execute: func(args []string, date time.Time, store *store.Store) error {
     14 		entries, err := store.GetAllEntries()
     15 		if err != nil {
     16 			return err
     17 		}
     18 
     19 		fmt.Println(report.New(entries).Format())
     20 
     21 		return nil
     22 	},
     23 
     24 	description: "report user and entry statistics",
     25 	help:        help.Report,
     26 	name:        "report",
     27 }