Root returns the Command at the root of the graph
()
| 338 | |
| 339 | // Root returns the Command at the root of the graph |
| 340 | func (cmd *Command) Root() *Command { |
| 341 | if cmd.parent == nil { |
| 342 | return cmd |
| 343 | } |
| 344 | |
| 345 | return cmd.parent.Root() |
| 346 | } |
| 347 | |
| 348 | func (cmd *Command) set(fName string, f Flag, val string) error { |
| 349 | cmd.setFlags[f] = struct{}{} |
no outgoing calls