Add aliases to tree help output

This commit is contained in:
Joe Schmitt
2021-02-12 11:51:30 -05:00
committed by Alec Thomas
parent 405b2f4fd9
commit f306ae1529
2 changed files with 12 additions and 9 deletions
+3
View File
@@ -474,6 +474,9 @@ func (h *HelpOptions) CommandTree(node *Node, prefix string) (rows [][2]string)
switch node.Type {
default:
nodeName += prefix + node.Name
if len(node.Aliases) != 0 {
nodeName += fmt.Sprintf(" (%s)", strings.Join(node.Aliases, ","))
}
case ArgumentNode:
nodeName += prefix + "<" + node.Name + ">"
}