| 134 | // ============================================================================= |
| 135 | |
| 136 | const splitExecutable = <A>(self: CliApp.CliApp<A>, args: ReadonlyArray<string>): [ |
| 137 | executable: string, |
| 138 | args: ReadonlyArray<string> |
| 139 | ] => { |
| 140 | if (self.executable !== undefined) { |
| 141 | return [self.executable, Arr.drop(args, 2)] |
| 142 | } |
| 143 | const [[runtime, script], optionsAndArgs] = Arr.splitAt(args, 2) |
| 144 | return [`${runtime} ${script}`, optionsAndArgs] |
| 145 | } |
| 146 | |
| 147 | const printDocs = (error: HelpDoc.HelpDoc): Effect.Effect<void> => Console.error(InternalHelpDoc.toAnsiText(error)) |
| 148 | |