(argv: string[])
| 24 | } |
| 25 | |
| 26 | function parseArgs(argv: string[]): { pattern: string } { |
| 27 | let pattern: string | undefined; |
| 28 | |
| 29 | for (let index = 0; index < argv.length; index += 1) { |
| 30 | const arg = argv[index]; |
| 31 | if (arg === "--pattern") { |
| 32 | pattern = argv[index + 1]; |
| 33 | index += 1; |
| 34 | } else { |
| 35 | console.error(`Unknown argument: ${arg}`); |
| 36 | usage(); |
| 37 | process.exit(1); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | if (!pattern) { |
| 42 | usage(); |
| 43 | process.exit(1); |
| 44 | } |
| 45 | |
| 46 | return { pattern }; |
| 47 | } |
| 48 | |
| 49 | async function fetchJobs( |
| 50 | owner: string, |
no test coverage detected