diff --git a/cmd/scw/testdata/test-main-usage-usage.golden b/cmd/scw/testdata/test-main-usage-usage.golden index e6f07ad15b..8a60b9c84f 100644 --- a/cmd/scw/testdata/test-main-usage-usage.golden +++ b/cmd/scw/testdata/test-main-usage-usage.golden @@ -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 diff --git a/internal/core/bootstrap.go b/internal/core/bootstrap.go index acd7a8dc3c..b70b6d4a02 100644 --- a/internal/core/bootstrap.go +++ b/internal/core/bootstrap.go @@ -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" ) @@ -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 {