From 73425cd8951d41fba7312a3412008b8368499832 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 22 Jul 2022 10:20:54 -0700 Subject: [PATCH] tools: add verbose flag to inactive TSC finder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/43897#issuecomment-1189682369 PR-URL: https://github.com/nodejs/node/pull/43913 Reviewed-By: Matteo Collina Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Darshan Sen Reviewed-By: Joyee Cheung Reviewed-By: Tierney Cyren Reviewed-By: Luigi Pinca Reviewed-By: Myles Borins --- tools/find-inactive-tsc.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/find-inactive-tsc.mjs b/tools/find-inactive-tsc.mjs index 5c4c37038988b0..fe204d5b673e59 100755 --- a/tools/find-inactive-tsc.mjs +++ b/tools/find-inactive-tsc.mjs @@ -12,8 +12,15 @@ import cp from 'node:child_process'; import fs from 'node:fs'; import path from 'node:path'; import readline from 'node:readline'; +import { parseArgs } from 'node:util'; -const SINCE = process.argv[2] || '3 months ago'; +const args = parseArgs({ + allowPositionals: true, + options: { verbose: { type: 'boolean', short: 'v' } } +}); + +const verbose = args.values.verbose; +const SINCE = args.positionals[0] || '3 months ago'; async function runGitCommand(cmd, options = {}) { const childProcess = cp.spawn('/bin/sh', ['-c', cmd], { @@ -271,3 +278,8 @@ if (inactive.length) { fs.writeFileSync(new URL('../README.md', import.meta.url), newReadmeText); } } + +if (verbose) { + console.log(attendance); + console.log(votingRecords); +}