MCPcopy Create free account
hub / github.com/SethGammon/Citadel / parseArgs

Function parseArgs

scripts/telemetry-otlp-export.js:28–58  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

26const DEFAULT_OTLP_METRICS_PATH = '/v1/metrics';
27
28function parseArgs(argv) {
29 const args = {
30 projectRoot: process.env.CLAUDE_PROJECT_DIR || process.cwd(),
31 endpoint: null,
32 dryRun: false,
33 reset: false,
34 help: false,
35 errors: [],
36 };
37
38 for (let index = 2; index < argv.length; index++) {
39 const arg = argv[index];
40 if (arg === '--endpoint') {
41 args.endpoint = argv[index + 1] || null;
42 index++;
43 } else if (arg === '--project-root') {
44 args.projectRoot = path.resolve(argv[index + 1] || process.cwd());
45 index++;
46 } else if (arg === '--dry-run') {
47 args.dryRun = true;
48 } else if (arg === '--reset') {
49 args.reset = true;
50 } else if (arg === '--help' || arg === '-h') {
51 args.help = true;
52 } else {
53 args.errors.push(`unknown argument: ${arg}`);
54 }
55 }
56
57 return args;
58}
59
60function usage() {
61 return [

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected