Skip to content

Commit 0c23a71

Browse files
committed
Support for 'hidden' commands
1 parent 501b8a4 commit 0c23a71

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

cli.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ type Command struct {
6565
// Flag is a set of flags specific to this command.
6666
Flag flag.FlagSet
6767

68+
// Hidden is a flat to hide command from global help commands listing
69+
Hidden bool
70+
6871
// API is the interface used to communicate with Scaleway's API
6972
API *ScalewayAPI
7073
}

help.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Options:
3939
-v, --version=false Print version information and quit
4040
4141
Commands:
42-
{{range .}} {{.Name | printf "%-9s"}} {{.Description}}
43-
{{end}}
42+
{{range .}}{{if not .Hidden}} {{.Name | printf "%-9s"}} {{.Description}}
43+
{{end}}{{end}}
4444
Run 'scw COMMAND --help' for more information on a command.
4545
`
4646

0 commit comments

Comments
 (0)