diff options
Diffstat (limited to 'command/node.go')
| -rw-r--r-- | command/node.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/command/node.go b/command/node.go index 4d09c975..b6f84bf8 100644 --- a/command/node.go +++ b/command/node.go @@ -6,6 +6,7 @@ import ( "strings" ) +// A node represents a command. type node struct { child, next *node name, usage string @@ -13,13 +14,16 @@ type node struct { out io.Writer logf LogFunc + // Names of commands preceding node. prefix []string + // Short user-facing representations of flags received by node. suffix strings.Builder f HandlerFunc set *flag.FlagSet } +// adopt adds v as the last child of n. func (n *node) adopt(v *node) bool { if n.child != nil { return n.child.append(v) @@ -28,6 +32,7 @@ func (n *node) adopt(v *node) bool { return true } +// append adds v as the last sibling of n. func (n *node) append(v *node) bool { if n.name == v.name { return false |
