(args: readonly string[])
| 23 | * directly or through `help`, or null when they ask for something else. |
| 24 | */ |
| 25 | export function requestedViewerCommand(args: readonly string[]): string | null { |
| 26 | const positional = args.filter((arg) => !PROGRAM_FLAGS.has(arg)); |
| 27 | const command = positional[0] === 'help' ? positional[1] : positional[0]; |
| 28 | return command !== undefined && VIEWER_COMMANDS.has(command) ? command : null; |
| 29 | } |
no test coverage detected