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

Function parse

apps/kimi-code/test/cli/options.test.ts:7–30  ·  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
10 const program = createProgram(
11 '0.1.0-test',
12 (opts) => {
13 captured = opts;
14 },
15 () => {},
16 );
17
18 program.exitOverride();
19 program.configureOutput({
20 writeOut: () => {},
21 writeErr: () => {},
22 });
23
24 program.parse(['node', 'kimi', ...argv]);
25
26 if (captured === undefined) {
27 throw new Error('Main action handler was not called');
28 }
29 return captured;
30}
31
32describe('CLI options parsing', () => {
33 describe('defaults', () => {

Callers 2

options.test.tsFile · 0.70
defaultCwdForPathFunction · 0.50

Calls 1

createProgramFunction · 0.90

Tested by

no test coverage detected