Skip to content

Commit 12bf164

Browse files
author
openset
committed
Add: Hidden
1 parent 0eac521 commit 12bf164

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/base/base.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type Command struct {
2020
UsageLine string
2121
Short string
2222
Long string
23+
Hidden bool
2324
}
2425

2526
func (c *Command) Name() string {
@@ -48,7 +49,9 @@ func Usage() {
4849
fmt.Printf("\t%s <command> [arguments]\n", CmdName)
4950
fmt.Println("The commands are:")
5051
for _, cmd := range Commands {
51-
fmt.Printf("\t%-11s \t%s\n", cmd.Name(), cmd.Short)
52+
if !cmd.Hidden {
53+
fmt.Printf("\t%-11s \t%s\n", cmd.Name(), cmd.Short)
54+
}
5255
}
5356
fmt.Printf("\nUse \"%s help <command>\" for more information about a command.", CmdName)
5457
fmt.Println()

0 commit comments

Comments
 (0)