diff --git a/cmd/ry/commands/domain/domain.go b/cmd/ry/commands/domain/domain.go index 87baaf6..1488019 100644 --- a/cmd/ry/commands/domain/domain.go +++ b/cmd/ry/commands/domain/domain.go @@ -41,13 +41,12 @@ func Cmd(rySDK **sdk.RainyunSDK, out **output.Printer) *cobra.Command { } dnsCmd := &cobra.Command{ - Use: "dns ", + Use: "dns", Short: "Manage DNS records", - Args: cobra.ExactArgs(1), } dnsListCmd := &cobra.Command{ - Use: "list", + Use: "list ", Short: "List DNS records", RunE: func(cmd *cobra.Command, args []string) error { id, err := strconv.Atoi(args[0]) diff --git a/cmd/ry/commands/storage/storage.go b/cmd/ry/commands/storage/storage.go index 19c0114..33889ff 100644 --- a/cmd/ry/commands/storage/storage.go +++ b/cmd/ry/commands/storage/storage.go @@ -42,13 +42,12 @@ func Cmd(rySDK **sdk.RainyunSDK, out **output.Printer) *cobra.Command { } bucketCmd := &cobra.Command{ - Use: "bucket ", + Use: "bucket", Short: "Manage buckets", - Args: cobra.ExactArgs(1), } bucketListCmd := &cobra.Command{ - Use: "list", + Use: "list ", Short: "List buckets", RunE: func(cmd *cobra.Command, args []string) error { instanceID, err := strconv.Atoi(args[0]) @@ -71,7 +70,7 @@ func Cmd(rySDK **sdk.RainyunSDK, out **output.Printer) *cobra.Command { } bucketCreateCmd := &cobra.Command{ - Use: "create ", + Use: "create ", Short: "Create a bucket", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/cmd/ry/root.go b/cmd/ry/root.go index c6155ca..33727e2 100644 --- a/cmd/ry/root.go +++ b/cmd/ry/root.go @@ -76,6 +76,8 @@ Use "ry [command] --help" for more information about a command.`, } func init() { + rootCmd.SilenceErrors = true + rootCmd.SilenceUsage = true cfgPath = config.DefaultPath() rootCmd.PersistentFlags().StringVar(&flagAPIKey, "apikey", "", "Rainyun API key") rootCmd.PersistentFlags().StringVarP(&flagOutput, "output", "o", "", "Output format: table, json, yaml, raw")