FlagNames returns a slice of flag names used by the this command and all of its parent commands.
()
| 545 | // FlagNames returns a slice of flag names used by the this command |
| 546 | // and all of its parent commands. |
| 547 | func (cmd *Command) FlagNames() []string { |
| 548 | names := cmd.LocalFlagNames() |
| 549 | |
| 550 | if cmd.parent != nil { |
| 551 | names = append(cmd.parent.FlagNames(), names...) |
| 552 | } |
| 553 | |
| 554 | return names |
| 555 | } |
| 556 | |
| 557 | // Lineage returns *this* command and all of its ancestor commands |
| 558 | // in order from child to parent |