| 301 | } |
| 302 | |
| 303 | const prefixCommand = <A>(self: Command.Command<A>): ReadonlyArray<string> => { |
| 304 | let command: InternalCommand.Instruction | undefined = self as InternalCommand.Instruction |
| 305 | let prefix: ReadonlyArray<string> = Arr.empty() |
| 306 | while (command !== undefined) { |
| 307 | switch (command._tag) { |
| 308 | case "Standard": { |
| 309 | prefix = Arr.of(command.name) |
| 310 | command = undefined |
| 311 | break |
| 312 | } |
| 313 | case "GetUserInput": { |
| 314 | prefix = Arr.of(command.name) |
| 315 | command = undefined |
| 316 | break |
| 317 | } |
| 318 | case "Map": { |
| 319 | command = command.command |
| 320 | break |
| 321 | } |
| 322 | case "Subcommands": { |
| 323 | command = command.parent |
| 324 | break |
| 325 | } |
| 326 | } |
| 327 | } |
| 328 | return prefix |
| 329 | } |
| 330 | |
| 331 | const getWizardPrefix = ( |
| 332 | builtIn: BuiltInOptions.ShowWizard, |