()
| 167 | } |
| 168 | |
| 169 | func (cmd *Command) setupCommandGraph() { |
| 170 | tracef("setting up command graph (cmd=%[1]q)", cmd.Name) |
| 171 | |
| 172 | _ = cmd.Walk(func(sub *Command) error { |
| 173 | for _, subCmd := range sub.Commands { |
| 174 | subCmd.parent = sub |
| 175 | subCmd.setupSubcommand() |
| 176 | } |
| 177 | return nil |
| 178 | }) |
| 179 | } |
| 180 | |
| 181 | func (cmd *Command) setupSubcommand() { |
| 182 | tracef("setting up self as sub-command (cmd=%[1]q)", cmd.Name) |