()
| 42 | }; |
| 43 | |
| 44 | const parse_cli_options = (): CliOptions => { |
| 45 | const { values } = parseArgs({ |
| 46 | options: { |
| 47 | "debug-port": { type: "string" }, |
| 48 | "cdp-port": { type: "string" }, |
| 49 | "debug-main": { type: "boolean" }, |
| 50 | "debug-frida": { type: "boolean" }, |
| 51 | help: { type: "boolean", short: "h" }, |
| 52 | }, |
| 53 | allowPositionals: false, |
| 54 | }); |
| 55 | |
| 56 | if (values.help) { |
| 57 | print_help(); |
| 58 | process.exit(0); |
| 59 | } |
| 60 | |
| 61 | return { |
| 62 | debugPort: parse_port("--debug-port", values["debug-port"], DEBUG_PORT), |
| 63 | cdpPort: parse_port("--cdp-port", values["cdp-port"], CDP_PORT), |
| 64 | debugMain: values["debug-main"] ?? false, |
| 65 | debugFrida: values["debug-frida"] ?? false, |
| 66 | }; |
| 67 | }; |
| 68 | |
| 69 | export { CliOptions, parse_cli_options }; |
no test coverage detected