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"},
Args: cobra.ExactArgs(1),
RunE: delDb,
SilenceUsage: true,
}
func delDb(cmd *cobra.Command, args []string) error {

View file

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

View file

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

View file

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

View file

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