Skip to content

Commit 2f1028f

Browse files
committed
feat(cli): add verbose option #606
1 parent 5b9ce68 commit 2f1028f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

@commitlint/cli/src/cli.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ const flags = {
7979
description: 'toggle console output',
8080
type: 'boolean'
8181
},
82+
verbose: {
83+
alias: 'vb',
84+
default: false,
85+
description: 'show console output even on success',
86+
type: 'boolean'
87+
},
8288
to: {
8389
alias: 't',
8490
default: null,
@@ -198,7 +204,9 @@ async function main(options) {
198204
const output = format(report, {color: flags.color});
199205

200206
if (!flags.quiet) {
201-
console.log(output);
207+
if (!report.valid || report.warningCount > 0 || flags.verbose) {
208+
console.log(output);
209+
}
202210
}
203211

204212
if (!report.valid) {

foo.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)