INNER CODE UNIT · TypeScript
host
lazy-dinosaur/ccxt-mcp · src/index.ts:36
host = args[hostIndex + 1];
}
// --port 옵션 처리
const portIndex = args.indexOf('--port');
if (portIndex !== -1 && args.length > portIndex + 1) {
const parsedPort = Number.parseInt(args[portIndex + 1], 10);
if (!Number.isNaN(parsedPort) && parsedPort > 0 && parsedPort <= 65535) {
port = parsedPort;
} else {
console.error(`[ERROR] Invalid --port value: ${args[portIndex + 1]}`);
process.exit(1);
}
}
const showHelp = args.includes('--help') || args.includes('-h');
if (showHelp) {
console.error(`