MCPcopy Create free account
hub / github.com/PatrickJS/awesome-cursorrules / parseArgs

Function parseArgs

scripts/cleanup-legacy-artifacts.mjs:45–58  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

43}
44
45function parseArgs(argv) {
46 const parsed = {};
47
48 for (let i = 0; i < argv.length; i += 1) {
49 const arg = argv[i];
50 if (arg === "--root") {
51 parsed.root = argv[++i];
52 } else {
53 throw new Error(`Unknown argument: ${arg}`);
54 }
55 }
56
57 return parsed;
58}
59
60if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
61 try {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected