aboutsummaryrefslogtreecommitdiffhomepage
path: root/command/help.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-02-23 01:36:48 +0900
committerOphestra <cat@gensokyo.uk>2025-02-23 01:36:48 +0900
commit647c6ea21baa28192e5c4339ed4cdf83e994036e (patch)
treef1c0e5c757bb24c0be905951c86ba701f18cddee /command/help.go
parent416d93e8802dc4f42ce814edf874c79e2682af58 (diff)
command: hide internal commands
This marks commands as internal via a magic usage string. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'command/help.go')
-rw-r--r--command/help.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/command/help.go b/command/help.go
index a3735406..cb22ce50 100644
--- a/command/help.go
+++ b/command/help.go
@@ -44,8 +44,10 @@ func (n *node) writeCommands(w io.Writer) error {
if n == nil {
return nil
}
- if _, err := fmt.Fprintf(w, "\t%s\t%s\n", n.name, n.usage); err != nil {
- return err
+ if n.usage != UsageInternal {
+ if _, err := fmt.Fprintf(w, "\t%s\t%s\n", n.name, n.usage); err != nil {
+ return err
+ }
}
return n.next.writeCommands(w)
}