(argsForChildren: ReadonlyArray<string>)
| 674 | (arg) => !Arr.some(subcommands, ([name]) => name === arg) |
| 675 | ) |
| 676 | const parseChildrenWith = (argsForChildren: ReadonlyArray<string>) => |
| 677 | Effect.suspend(() => { |
| 678 | const iterator = self.children[Symbol.iterator]() |
| 679 | const loop = ( |
| 680 | next: Instruction |
| 681 | ): Effect.Effect< |
| 682 | Directive.CommandDirective<any>, |
| 683 | ValidationError.ValidationError, |
| 684 | FileSystem.FileSystem | Path.Path | Terminal.Terminal |
| 685 | > => { |
| 686 | return parseInternal(next, argsForChildren, config).pipe( |
| 687 | Effect.catchIf(InternalValidationError.isCommandMismatch, (e) => { |
| 688 | const next = iterator.next() |
| 689 | return next.done ? Effect.fail(e) : loop(next.value) |
| 690 | }) |
| 691 | ) |
| 692 | } |
| 693 | return loop(iterator.next().value!) |
| 694 | }) |
| 695 | const parseChildren = parseChildrenWith(childArgs) |
| 696 | const helpDirectiveForParent = Effect.sync(() => { |
| 697 | return InternalCommandDirective.builtIn(InternalBuiltInOptions.showHelp( |
no test coverage detected