MCPcopy
hub / github.com/marimo-team/marimo / parseMode

Function parseMode

packages/llm-info/src/cli.ts:32–47  ·  view source on GitHub ↗
(argv: readonly string[])

Source from the content-addressed store, hash-verified

30}
31
32function parseMode(argv: readonly string[]): SyncMode {
33 if (argv.includes("--replace") || argv.includes("-r")) {
34 return "replace";
35 }
36 // Accept both `--mode=replace` and the spaced form `--mode replace`.
37 const raw = getFlag(argv, ["--mode"]);
38 if (raw === "replace") {
39 return "replace";
40 }
41 if (raw !== undefined && raw !== "append") {
42 throw new Error(
43 `Unknown --mode value "${raw}" — expected "append" or "replace".`,
44 );
45 }
46 return "append";
47}
48
49function parseMaxPerProvider(argv: readonly string[]): number | undefined {
50 const raw = getFlag(argv, ["--max-per-provider", "--max", "-n"]);

Callers 1

parseCliArgsFunction · 0.85

Calls 1

getFlagFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…