Skip to content

Commit d999184

Browse files
authored
fix(core): remove default help command (#2706)
1 parent 63d043a commit d999184

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cmd/scw/testdata/test-main-usage-usage.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ AVAILABLE COMMANDS:
3333
version Display cli version
3434
vpc VPC API
3535
vpc-gw VPC Public Gateway API
36-
help Help about any command
3736

3837
FLAGS:
3938
-c, --config string The path to the config file

internal/core/bootstrap.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/scaleway/scaleway-cli/v2/internal/interactive"
1212
"github.com/scaleway/scaleway-sdk-go/logger"
1313
"github.com/scaleway/scaleway-sdk-go/scw"
14+
"github.com/spf13/cobra"
1415
"github.com/spf13/pflag"
1516
)
1617

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

212214
if err != nil {

0 commit comments

Comments
 (0)