|
7 | 7 | importcpfrom'node:child_process'; |
8 | 8 | importfsfrom'node:fs'; |
9 | 9 | importreadlinefrom'node:readline'; |
| 10 | +import{parseArgs}from'node:util'; |
10 | 11 |
|
11 | | -constSINCE=process.argv[2]||'18 months ago'; |
| 12 | +constargs=parseArgs({ |
| 13 | +allowPositionals: true, |
| 14 | +options: {verbose: {type: 'boolean',short: 'v'}} |
| 15 | +}); |
| 16 | + |
| 17 | +constverbose=args.values.verbose; |
| 18 | +constSINCE=args.positionals[0]||'18 months ago'; |
12 | 19 |
|
13 | 20 | asyncfunctionrunGitCommand(cmd,mapFn){ |
14 | 21 | constchildProcess=cp.spawn('/bin/sh',['-c',cmd],{ |
@@ -176,11 +183,12 @@ async function moveCollaboratorToEmeritus(peopleToMove) { |
176 | 183 | // Get list of current collaborators from README.md. |
177 | 184 | constcollaborators=awaitgetCollaboratorsFromReadme(); |
178 | 185 |
|
179 | | -console.log(`Since ${SINCE}:\n`); |
180 | | -console.log(`* ${authors.size.toLocaleString()} authors have made commits.`); |
181 | | -console.log(`* ${approvingReviewers.size.toLocaleString()} reviewers have approved landed commits.`); |
182 | | -console.log(`* ${collaborators.length.toLocaleString()} collaborators currently in the project.`); |
183 | | - |
| 186 | +if(verbose){ |
| 187 | +console.log(`Since ${SINCE}:\n`); |
| 188 | +console.log(`* ${authors.size.toLocaleString()} authors have made commits.`); |
| 189 | +console.log(`* ${approvingReviewers.size.toLocaleString()} reviewers have approved landed commits.`); |
| 190 | +console.log(`* ${collaborators.length.toLocaleString()} collaborators currently in the project.`); |
| 191 | +} |
184 | 192 | constinactive=collaborators.filter((collaborator)=> |
185 | 193 | !authors.has(collaborator.mailmap)&& |
186 | 194 | !approvingReviewers.has(collaborator.name) |
|
0 commit comments