(
args: ReadonlyArray<string>
)
| 568 | } |
| 569 | }) |
| 570 | const parseUserDefinedArgs = ( |
| 571 | args: ReadonlyArray<string> |
| 572 | ): Effect.Effect< |
| 573 | Directive.CommandDirective<unknown>, |
| 574 | ValidationError.ValidationError, |
| 575 | FileSystem.FileSystem | Path.Path | Terminal.Terminal |
| 576 | > => |
| 577 | parseCommandLine(self, args).pipe(Effect.flatMap((commandOptionsAndArgs) => { |
| 578 | const [optionsAndArgs, forcedCommandArgs] = splitForcedArgs(commandOptionsAndArgs) |
| 579 | return InternalOptions.processCommandLine(self.options, optionsAndArgs, config).pipe( |
| 580 | Effect.flatMap(([error, commandArgs, optionsType]) => |
| 581 | InternalArgs.validate( |
| 582 | self.args, |
| 583 | Arr.appendAll(commandArgs, forcedCommandArgs), |
| 584 | config |
| 585 | ).pipe( |
| 586 | Effect.catchAll((e) => |
| 587 | Option.match(error, { |
| 588 | onNone: () => Effect.fail(e), |
| 589 | onSome: (err) => Effect.fail(err) |
| 590 | }) |
| 591 | ), |
| 592 | Effect.map(([argsLeftover, argsType]) => |
| 593 | InternalCommandDirective.userDefined(argsLeftover, { |
| 594 | name: self.name, |
| 595 | options: optionsType, |
| 596 | args: argsType |
| 597 | }) |
| 598 | ) |
| 599 | ) |
| 600 | ) |
| 601 | ) |
| 602 | })) |
| 603 | const exhaustiveSearch = ( |
| 604 | args: ReadonlyArray<string> |
| 605 | ): Effect.Effect< |
no test coverage detected