campaigner/cmd/report.go
2020-09-24 14:02:04 +02:00

33 lines
547 B
Go

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()
}