MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / parseInteractiveArgv

Function parseInteractiveArgv

packages/hydrooj/src/entry/cli.ts:41–47  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

39}
40
41function parseInteractiveArgv(line: string) {
42 const args = parse(line);
43 if (!checkStringArray(args)) throw new Error('Shell operators are not supported in interactive mode.');
44 if (args[0] === 'hydrooj') args.shift();
45 if (args[0] === 'cli') args.shift();
46 return cac().parse(['node', 'hydrooj', 'cli', ...args], { run: false });
47}
48
49async function cli(commandArgv = argv) {
50 const [, modelName, func, ...args] = commandArgv.args as [string, string, string, ...any[]];

Callers 1

loadFunction · 0.85

Calls 2

parseFunction · 0.85
checkStringArrayFunction · 0.70

Tested by

no test coverage detected