Lineage returns *this* command and all of its ancestor commands in order from child to parent
()
| 557 | // Lineage returns *this* command and all of its ancestor commands |
| 558 | // in order from child to parent |
| 559 | func (cmd *Command) Lineage() []*Command { |
| 560 | lineage := []*Command{cmd} |
| 561 | |
| 562 | if cmd.parent != nil { |
| 563 | lineage = append(lineage, cmd.parent.Lineage()...) |
| 564 | } |
| 565 | |
| 566 | return lineage |
| 567 | } |
| 568 | |
| 569 | // FullName returns the full name of the command. |
| 570 | // Includes parent commands separated by space. |
no outgoing calls