feat(cmd): SilenceUsage all but root

This commit is contained in:
Lewis Wynne 2025-12-17 14:24:44 +00:00
parent f6f1376d1a
commit 06e09df829
5 changed files with 30 additions and 25 deletions

View file

@ -38,6 +38,7 @@ var delDbCmd = &cobra.Command{
Aliases: []string{"delete-db", "rm-db", "remove-db"}, Aliases: []string{"delete-db", "rm-db", "remove-db"},
Args: cobra.ExactArgs(1), Args: cobra.ExactArgs(1),
RunE: delDb, RunE: delDb,
SilenceUsage: true,
} }
func delDb(cmd *cobra.Command, args []string) error { func delDb(cmd *cobra.Command, args []string) error {

View file

@ -25,6 +25,7 @@ var dumpCmd = &cobra.Command{
Aliases: []string{"export"}, Aliases: []string{"export"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
RunE: dump, RunE: dump,
SilenceUsage: true,
} }
func dump(cmd *cobra.Command, args []string) error { func dump(cmd *cobra.Command, args []string) error {

View file

@ -33,6 +33,7 @@ var listDbsCmd = &cobra.Command{
Aliases: []string{"ls-dbs", "lsd"}, Aliases: []string{"ls-dbs", "lsd"},
Args: cobra.NoArgs, Args: cobra.NoArgs,
RunE: listDbs, RunE: listDbs,
SilenceUsage: true,
} }
func listDbs(cmd *cobra.Command, args []string) error { func listDbs(cmd *cobra.Command, args []string) error {

View file

@ -36,6 +36,7 @@ var listCmd = &cobra.Command{
Aliases: []string{"ls"}, Aliases: []string{"ls"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
RunE: list, RunE: list,
SilenceUsage: true,
} }
func list(cmd *cobra.Command, args []string) error { func list(cmd *cobra.Command, args []string) error {

View file

@ -19,6 +19,7 @@ var restoreCmd = &cobra.Command{
Aliases: []string{"import"}, Aliases: []string{"import"},
Args: cobra.MaximumNArgs(1), Args: cobra.MaximumNArgs(1),
RunE: restore, RunE: restore,
SilenceUsage: true,
} }
func restore(cmd *cobra.Command, args []string) error { func restore(cmd *cobra.Command, args []string) error {