Update Help.go to make Sub Commands can be Hidden (#207)
This commit is contained in:
@@ -539,6 +539,9 @@ func (h *HelpOptions) CommandTree(node *Node, prefix string) (rows [][2]string)
|
|||||||
rows = append(rows, [2]string{prefix + arg.Summary(), arg.Help})
|
rows = append(rows, [2]string{prefix + arg.Summary(), arg.Help})
|
||||||
}
|
}
|
||||||
for _, subCmd := range node.Children {
|
for _, subCmd := range node.Children {
|
||||||
|
if subCmd.Hidden {
|
||||||
|
continue
|
||||||
|
}
|
||||||
rows = append(rows, h.CommandTree(subCmd, prefix)...)
|
rows = append(rows, h.CommandTree(subCmd, prefix)...)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user