Skip to content

Commit

Permalink
feat: group main commands
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienaury committed Mar 24, 2024
1 parent 70163e6 commit 437124f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cmd/silo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,18 @@ There is NO WARRANTY, to the extent permitted by law.`, version, commit, buildDa
rootCmd.PersistentFlags().StringVar(&colormode, "color", "auto", "use colors in log outputs : yes, no or auto")
rootCmd.PersistentFlags().BoolVar(&profiling, "profiling", false, "enable cpu profiling and generate a cpu.pprof file")

rootCmd.AddCommand(cli.NewScanCommand(name, os.Stderr, os.Stdout, os.Stdin))
rootCmd.AddCommand(cli.NewDumpCommand(name, os.Stderr, os.Stdout, os.Stdin))
scanCmd := cli.NewScanCommand(name, os.Stderr, os.Stdout, os.Stdin)
dumpCmd := cli.NewDumpCommand(name, os.Stderr, os.Stdout, os.Stdin)

rootCmd.AddGroup(&cobra.Group{
ID: "main",
Title: "Main Commands:",
})

scanCmd.GroupID = "main"
dumpCmd.GroupID = "main"

rootCmd.AddCommand(scanCmd, dumpCmd)

if err := rootCmd.Execute(); err != nil {
log.Err(err).Msg("error when executing command")
Expand Down

0 comments on commit 437124f

Please sign in to comment.