From 6d1a320445875f236cd39b0e4ec06e2921e69b3b Mon Sep 17 00:00:00 2001 From: Garret Alfert Date: Sun, 26 Feb 2023 22:53:03 +0100 Subject: [PATCH] Add dry option --- index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index fc66833..7aea842 100644 --- a/index.js +++ b/index.js @@ -37,6 +37,11 @@ const argv = yargs(hideBin(process.argv)) alias: 'e', description: 'Include reviews for PRs merged before this date', }) + .option('dry', { + alias: 'd', + type: 'boolean', + description: 'Only list contribution details without creating them', + }) .help() .version() .demandOption('start', 'Please provide a start date') @@ -182,8 +187,11 @@ Promise.all([ generateContributionData(reviews, kredits.Contributor).then( (contributionData) => { - console.log('contributions:'); - console.log(util.inspect(contributionData, { depth: 3, colors: true })); + if (argv.dry) { + console.log('contributions:'); + console.log(util.inspect(contributionData, { depth: 3, colors: true })); + return; + } } ); });