| 117 | const subcommands = options.subcommands ?? [] |
| 118 | |
| 119 | const handle = ( |
| 120 | input: Input, |
| 121 | commandPath: ReadonlyArray<string> |
| 122 | ): Effect.Effect<void, CliError.CliError | E, R | Environment> => |
| 123 | Predicate.isNotUndefined(options.handle) |
| 124 | ? options.handle(input, commandPath) |
| 125 | : Effect.fail(new CliError.ShowHelp({ commandPath, errors: [] })) |
| 126 | |
| 127 | const parse = options.parse ?? makeParser(config) as any |
| 128 | const parseContext = options.parseContext ?? makeParser(contextConfig, { allowLeftovers: true }) as any |