Skip to content

Commit 6ca6709

Browse files
committed
fix(cli): avoid pipe overload in command matcher
Effect\x27s pipe typings cap at 20 args; split Match.orElse into a second pipe call.
1 parent 2918dd7 commit 6ca6709

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

packages/app/src/docker-git/cli/parser.ts

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,28 @@ export const parseArgs = (args: ReadonlyArray<string>): Either.Either<Command, P
4949
command: command ?? ""
5050
}
5151

52-
return Match.value(command).pipe(
53-
Match.when("create", () => parseCreate(rest)),
54-
Match.when("init", () => parseCreate(rest)),
55-
Match.when("clone", () => parseClone(rest)),
56-
Match.when("attach", () => parseAttach(rest)),
57-
Match.when("tmux", () => parseAttach(rest)),
58-
Match.when("panes", () => parsePanes(rest)),
59-
Match.when("terms", () => parsePanes(rest)),
60-
Match.when("terminals", () => parsePanes(rest)),
61-
Match.when("sessions", () => parseSessions(rest)),
62-
Match.when("mcp-playwright", () => parseMcpPlaywright(rest)),
63-
Match.when("help", () => Either.right(helpCommand)),
64-
Match.when("ps", () => Either.right(statusCommand)),
65-
Match.when("status", () => Either.right(statusCommand)),
66-
Match.when("down-all", () => Either.right(downAllCommand)),
67-
Match.when("stop-all", () => Either.right(downAllCommand)),
68-
Match.when("kill-all", () => Either.right(downAllCommand)),
69-
Match.when("menu", () => Either.right(menuCommand)),
70-
Match.when("ui", () => Either.right(menuCommand)),
71-
Match.when("auth", () => parseAuth(rest)),
72-
Match.when("state", () => parseState(rest)),
73-
Match.orElse(() => Either.left(unknownCommandError))
74-
)
52+
return Match.value(command)
53+
.pipe(
54+
Match.when("create", () => parseCreate(rest)),
55+
Match.when("init", () => parseCreate(rest)),
56+
Match.when("clone", () => parseClone(rest)),
57+
Match.when("attach", () => parseAttach(rest)),
58+
Match.when("tmux", () => parseAttach(rest)),
59+
Match.when("panes", () => parsePanes(rest)),
60+
Match.when("terms", () => parsePanes(rest)),
61+
Match.when("terminals", () => parsePanes(rest)),
62+
Match.when("sessions", () => parseSessions(rest)),
63+
Match.when("mcp-playwright", () => parseMcpPlaywright(rest)),
64+
Match.when("help", () => Either.right(helpCommand)),
65+
Match.when("ps", () => Either.right(statusCommand)),
66+
Match.when("status", () => Either.right(statusCommand)),
67+
Match.when("down-all", () => Either.right(downAllCommand)),
68+
Match.when("stop-all", () => Either.right(downAllCommand)),
69+
Match.when("kill-all", () => Either.right(downAllCommand)),
70+
Match.when("menu", () => Either.right(menuCommand)),
71+
Match.when("ui", () => Either.right(menuCommand)),
72+
Match.when("auth", () => parseAuth(rest)),
73+
Match.when("state", () => parseState(rest))
74+
)
75+
.pipe(Match.orElse(() => Either.left(unknownCommandError)))
7576
}

0 commit comments

Comments
 (0)