(name, dflt = undefined)
| 62 | const command = args[0]; |
| 63 | |
| 64 | const flag = (name, dflt = undefined) => { |
| 65 | const i = args.indexOf(`--${name}`); |
| 66 | if (i < 0) return dflt; |
| 67 | const next = args[i + 1]; |
| 68 | return next && !next.startsWith("--") ? next : true; |
| 69 | }; |
| 70 | const positional = args.slice(1).filter((a, i, all) => { |
| 71 | if (a.startsWith("--")) return false; |
| 72 | const prev = all[i - 1]; |
no outgoing calls
no test coverage detected