MCPcopy Index your code
hub / github.com/cursor/community-plugins / parseArgs

Function parseArgs

apps/cursor/src/scripts/insert-from-jsonl.ts:34–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32};
33
34function parseArgs(): Args {
35 const argv = process.argv.slice(2);
36 const out: Args = {
37 input: "apps/cursor/.seed/plugins.jsonl",
38 limit: Number.POSITIVE_INFINITY,
39 dryRun: false,
40 };
41 for (let i = 0; i < argv.length; i++) {
42 const a = argv[i];
43 if (a === "--input") out.input = argv[++i];
44 else if (a === "--limit") out.limit = Number(argv[++i]);
45 else if (a === "--dry-run") out.dryRun = true;
46 else if (a === "--help" || a === "-h") {
47 console.log(
48 "Usage: insert-from-jsonl.ts [--input path] [--limit N] [--dry-run]",
49 );
50 process.exit(0);
51 } else {
52 console.error(`Unknown arg: ${a}`);
53 process.exit(1);
54 }
55 }
56 return out;
57}
58
59async function* readRows(path: string): AsyncGenerator<ExtractedRow> {
60 // Stream-like read by splitting the whole file by newlines. JSONL files at

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected