From af533a38fb593823ca862dd886b7167186eff07e Mon Sep 17 00:00:00 2001 From: Rene Zbinden Date: Tue, 18 Feb 2020 21:47:05 +0100 Subject: [PATCH] make HelperOptions CommandTree method exported --- help.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/help.go b/help.go index 0ea9004..8bb67cd 100644 --- a/help.go +++ b/help.go @@ -176,7 +176,7 @@ func writeCommandTree(w *helpWriter, node *Node) { if cmd.Hidden { continue } - rows = append(rows, w.commandTree(cmd, "")...) + rows = append(rows, w.CommandTree(cmd, "")...) if i != len(node.Children)-1 { rows = append(rows, [2]string{"", ""}) } @@ -349,8 +349,8 @@ func formatFlag(haveShort bool, flag *Flag) string { return flagString } -// commandTree creates a tree with the given node name as root and its children's arguments and sub commands as leaves. -func (h *HelpOptions) commandTree(node *Node, prefix string) (rows [][2]string) { +// CommandTree creates a tree with the given node name as root and its children's arguments and sub commands as leaves. +func (h *HelpOptions) CommandTree(node *Node, prefix string) (rows [][2]string) { var nodeName string switch node.Type { default: @@ -368,7 +368,7 @@ func (h *HelpOptions) commandTree(node *Node, prefix string) (rows [][2]string) rows = append(rows, [2]string{prefix + arg.Summary(), arg.Help}) } for _, subCmd := range node.Children { - rows = append(rows, h.commandTree(subCmd, prefix)...) + rows = append(rows, h.CommandTree(subCmd, prefix)...) } return }