MCPcopy
hub / github.com/KeygraphHQ/shannon / parseStartArgs

Function parseStartArgs

apps/cli/src/index.ts:119–196  ·  view source on GitHub ↗
(argv: string[])

Source from the content-addressed store, hash-verified

117}
118
119function parseStartArgs(argv: string[]): ParsedStartArgs {
120 let url = '';
121 let repo = '';
122 let config: string | undefined;
123 let workspace: string | undefined;
124 let output: string | undefined;
125 let pipelineTesting = false;
126 let debug = false;
127
128 for (let i = 0; i < argv.length; i++) {
129 const arg = argv[i];
130 const next = argv[i + 1];
131
132 switch (arg) {
133 case '-u':
134 case '--url':
135 if (next && !next.startsWith('-')) {
136 url = next;
137 i++;
138 }
139 break;
140 case '-r':
141 case '--repo':
142 if (next && !next.startsWith('-')) {
143 repo = next;
144 i++;
145 }
146 break;
147 case '-c':
148 case '--config':
149 if (next && !next.startsWith('-')) {
150 config = next;
151 i++;
152 }
153 break;
154 case '-w':
155 case '--workspace':
156 if (next && !next.startsWith('-')) {
157 workspace = next;
158 i++;
159 }
160 break;
161 case '-o':
162 case '--output':
163 if (next && !next.startsWith('-')) {
164 output = next;
165 i++;
166 }
167 break;
168 case '--pipeline-testing':
169 pipelineTesting = true;
170 break;
171 case '--debug':
172 debug = true;
173 break;
174 default:
175 console.error(`Unknown option: ${arg}`);
176 console.error(`Run "${getMode() === 'local' ? './shannon' : 'npx @keygraph/shannon'} help" for usage`);

Callers 1

index.tsFile · 0.85

Calls 2

getModeFunction · 0.85
errorMethod · 0.65

Tested by

no test coverage detected