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