MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / parse

Function parse

apps/kimi-code/test/cli/session-flag-picker.test.ts:7–26  ·  view source on GitHub ↗
(argv: string[])

Source from the content-addressed store, hash-verified

5import { OptionConflictError, validateOptions } from '#/cli/options';
6
7function parse(argv: string[]): CLIOptions {
8 let captured: CLIOptions | undefined;
9 const program = createProgram(
10 '0.0.0-test',
11 (opts) => {
12 captured = opts;
13 },
14 () => {},
15 );
16 program.exitOverride();
17 program.configureOutput({
18 writeOut: () => {},
19 writeErr: () => {},
20 });
21 program.parse(['node', 'kimi', ...argv]);
22 if (captured === undefined) {
23 throw new Error('Main action handler was not called');
24 }
25 return captured;
26}
27
28describe('--session / -r / -S picker routing', () => {
29 describe('argParser: no-arg forms coerce to empty string', () => {

Callers 1

Calls 1

createProgramFunction · 0.90

Tested by

no test coverage detected