Skip to content

Commit

Permalink
fix(core): remove default help command (#2706)
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax authored Dec 27, 2022
1 parent 63d043a commit d999184
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion cmd/scw/testdata/test-main-usage-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ AVAILABLE COMMANDS:
version Display cli version
vpc VPC API
vpc-gw VPC Public Gateway API
help Help about any command

FLAGS:
-c, --config string The path to the config file
Expand Down
2 changes: 2 additions & 0 deletions internal/core/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/scaleway/scaleway-cli/v2/internal/interactive"
"github.com/scaleway/scaleway-sdk-go/logger"
"github.com/scaleway/scaleway-sdk-go/scw"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)

Expand Down Expand Up @@ -207,6 +208,7 @@ func Bootstrap(config *BootstrapConfig) (exitCode int, result interface{}, err e
rootCmd.PersistentFlags().StringVarP(&outputFlag, "output", "o", "human", "Output format: json or human, see 'scw help output' for more info")
rootCmd.PersistentFlags().BoolVarP(&debug, "debug", "D", false, "Enable debug mode")
rootCmd.SetArgs(config.Args[1:])
rootCmd.SetHelpCommand(&cobra.Command{Hidden: true})
err = rootCmd.Execute()

if err != nil {
Expand Down

0 comments on commit d999184

Please sign in to comment.