Add report user command

This commit is contained in:
Miguel de la Cruz 2020-09-24 14:02:04 +02:00
parent 177ed7fd6e
commit 0e6678534e
5 changed files with 69 additions and 4 deletions

33
cmd/report.go Normal file
View file

@ -0,0 +1,33 @@
package cmd
import (
"github.com/spf13/cobra"
"git.ctrlz.es/mgdelacroix/campaigner/app"
)
func UsersReportCmd() *cobra.Command {
return &cobra.Command{
Use: "users",
Short: "A users report",
Args: cobra.NoArgs,
Run: withApp(userReportCmdF),
}
}
func ReportCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "report",
Short: "Generates reports on campaign information",
}
cmd.AddCommand(
UserReportCmd(),
)
return cmd
}
func userReportCmdF(a *app.App, cmd *cobra.Command, _ []string) {
a.Campaign.PrintUserReport()
}

View file

@ -51,6 +51,7 @@ func RootCmd() *cobra.Command {
PublishCmd(),
PullCmd(),
SyncCmd(),
ReportCmd(),
)
return cmd