campaigner/cmd/report.go

34 lines
555 B
Go
Raw Normal View History

2020-09-24 12:02:04 +00:00
package cmd
import (
"github.com/spf13/cobra"
"git.ctrlz.es/mgdelacroix/campaigner/app"
)
func UsersReportCmd() *cobra.Command {
return &cobra.Command{
2020-09-24 17:01:18 +00:00
Use: "users",
2020-09-24 12:02:04 +00:00
Short: "A users report",
2020-09-24 17:01:18 +00:00
Args: cobra.NoArgs,
Run: withApp(userReportCmdF),
2020-09-24 12:02:04 +00:00
}
}
func ReportCmd() *cobra.Command {
cmd := &cobra.Command{
2020-09-24 17:01:18 +00:00
Use: "report",
2020-09-24 12:02:04 +00:00
Short: "Generates reports on campaign information",
}
cmd.AddCommand(
2020-09-24 12:02:36 +00:00
UsersReportCmd(),
2020-09-24 12:02:04 +00:00
)
return cmd
}
func userReportCmdF(a *app.App, cmd *cobra.Command, _ []string) {
a.Campaign.PrintUserReport()
}