MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / parseArgs

Function parseArgs

scripts/dev-static.mjs:118–163  ·  view source on GitHub ↗
(argv = process.argv.slice(2))

Source from the content-addressed store, hash-verified

116// ═══════════════════════════════════════════════════════════════════════════
117
118export function parseArgs(argv = process.argv.slice(2)) {
119 const config = {
120 port: null,
121 automationGitRef: null,
122 automationRepo: null,
123 skipBuild: false,
124 verbose: false,
125 host: null,
126 allowLanSessionKey: false,
127 };
128
129 for (let i = 0; i < argv.length; i++) {
130 switch (argv[i]) {
131 case "-p":
132 case "--port":
133 config.port = parseInt(argv[++i], 10);
134 break;
135 case "-H":
136 case "--host":
137 config.host = argv[++i];
138 break;
139 case "--allow-lan-session-key":
140 config.allowLanSessionKey = true;
141 break;
142 case "--automation-ref":
143 config.automationGitRef = argv[++i];
144 break;
145 case "--automation-repo":
146 config.automationRepo = argv[++i];
147 break;
148 case "--skip-build":
149 config.skipBuild = true;
150 break;
151 case "-v":
152 case "--verbose":
153 config.verbose = true;
154 break;
155 case "-h":
156 case "--help":
157 showHelp();
158 process.exit(0);
159 }
160 }
161
162 return config;
163}
164
165function showHelp() {
166 console.log(`

Callers 1

mainFunction · 0.70

Calls 1

showHelpFunction · 0.70

Tested by

no test coverage detected