* Walk through the command's parent tree and construct a space-separated name. * * Probably overkill because we don't have nested commands, but whatever.
(cmd: Command)
| 177 | * Probably overkill because we don't have nested commands, but whatever. |
| 178 | */ |
| 179 | function getFullCommandName(cmd: Command): string { |
| 180 | const names: string[] = []; |
| 181 | |
| 182 | while (cmd.parent !== null) { |
| 183 | names.push(cmd.name()); |
| 184 | cmd = cmd.parent; |
| 185 | } |
| 186 | |
| 187 | return names.reverse().join(' '); |
| 188 | } |