Add report user command
This commit is contained in:
parent
177ed7fd6e
commit
0e6678534e
5 changed files with 69 additions and 4 deletions
33
cmd/report.go
Normal file
33
cmd/report.go
Normal 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()
|
||||
}
|
|
@ -51,6 +51,7 @@ func RootCmd() *cobra.Command {
|
|||
PublishCmd(),
|
||||
PullCmd(),
|
||||
SyncCmd(),
|
||||
ReportCmd(),
|
||||
)
|
||||
|
||||
return cmd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue