| 29 | ): Promise<A> => Effect.provide(self, NodeContext.layer).pipe(Effect.runPromise) |
| 30 | |
| 31 | const process = <A>( |
| 32 | options: Options.Options<A>, |
| 33 | args: ReadonlyArray<string>, |
| 34 | config: CliConfig.CliConfig |
| 35 | ): Effect.Effect< |
| 36 | [ReadonlyArray<string>, A], |
| 37 | ValidationError.ValidationError, |
| 38 | NodeContext.NodeContext |
| 39 | > => |
| 40 | Options.processCommandLine(options, args, config).pipe( |
| 41 | Effect.flatMap(([err, rest, a]) => |
| 42 | Option.match(err, { |
| 43 | onNone: () => Effect.succeed([rest, a]), |
| 44 | onSome: Effect.fail |
| 45 | }) |
| 46 | ) |
| 47 | ) |
| 48 | |
| 49 | describe("Options", () => { |
| 50 | it("should validate without ambiguity", () => |