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

Function parseArgs

apps/kimi-code/scripts/build-plugin-marketplace-cdn.mjs:217–236  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

215}
216
217function parseArgs(args) {
218 const out = {};
219 for (let i = 0; i < args.length; i++) {
220 const arg = args[i];
221 if (arg === '--plugins-root') {
222 out.pluginsRoot = requiredValue(args, ++i, arg);
223 continue;
224 }
225 if (arg === '--out-dir') {
226 out.outDir = requiredValue(args, ++i, arg);
227 continue;
228 }
229 if (arg === '-h' || arg === '--help') {
230 printHelp();
231 process.exit(0);
232 }
233 throw new Error(`Unknown argument: ${arg}`);
234 }
235 return out;
236}
237
238function requiredValue(args, index, flag) {
239 const value = args[index];

Callers 3

parseCliArgsFunction · 0.85
build.mjsFile · 0.85

Calls 3

requiredValueFunction · 0.85
printHelpFunction · 0.85
exitMethod · 0.65

Tested by

no test coverage detected