(args: string[], flag: string)
| 41 | } |
| 42 | |
| 43 | function getFlag(args: string[], flag: string): string | undefined { |
| 44 | const idx = args.indexOf(flag); |
| 45 | if (idx === -1) return undefined; |
| 46 | const value = args[idx + 1]; |
| 47 | // Don't consume another flag as a value |
| 48 | if (value === undefined || value.startsWith("--")) return undefined; |
| 49 | return value; |
| 50 | } |
| 51 | |
| 52 | function getFlags(args: string[], flag: string): string[] { |
| 53 | const values: string[] = []; |
no outgoing calls
no test coverage detected