(argv)
| 37 | } |
| 38 | |
| 39 | function parseArgs(argv) { |
| 40 | const args = { since: null, json: false }; |
| 41 | for (let i = 2; i < argv.length; i++) { |
| 42 | const a = argv[i]; |
| 43 | if (a === '--json') args.json = true; |
| 44 | else if (a === '--since') { |
| 45 | args.since = argv[++i]; |
| 46 | } else if (a.startsWith('--since=')) { |
| 47 | args.since = a.slice('--since='.length); |
| 48 | } else if (a === '--help' || a === '-h') { |
| 49 | args.help = true; |
| 50 | } |
| 51 | } |
| 52 | return args; |
| 53 | } |
| 54 | |
| 55 | function percentile(sorted, p) { |
| 56 | if (!sorted.length) return 0; |