From 85c6e7055c5362dcbaac9b04e366787d972955dc Mon Sep 17 00:00:00 2001 From: escapedcat Date: Thu, 4 Apr 2019 12:38:54 +0800 Subject: [PATCH] feat(cli): add verbose option #606 --- @commitlint/cli/src/cli.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/@commitlint/cli/src/cli.js b/@commitlint/cli/src/cli.js index 49afd48258..36735235cf 100755 --- a/@commitlint/cli/src/cli.js +++ b/@commitlint/cli/src/cli.js @@ -79,6 +79,12 @@ const flags = { description: 'toggle console output', type: 'boolean' }, + verbose: { + alias: 'vb', + default: false, + description: 'show console output even on success', + type: 'boolean' + }, to: { alias: 't', default: null, @@ -198,7 +204,9 @@ async function main(options) { const output = format(report, {color: flags.color}); if (!flags.quiet) { - console.log(output); + if (!report.valid || report.warningCount > 0 || flags.verbose) { + console.log(output); + } } if (!report.valid) {