campaigner/cmd/report.go

34 lines
555 B
Go
Raw Normal View History

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