Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit d886e2b

Browse files
committedJul 28, 2019
SEMIBREAKING: Make --quiet the standard, add --verbose
Align with other tools and only log failures, not successes, by default This is breaking if you relied on the output of a log on success
1 parent 5e4f11b commit d886e2b

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed
 

‎cli.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const args = require('minimist')(process.argv.slice(2), {
1515
extra: false,
1616
dev: true,
1717
'default-entries': true,
18-
quiet: false
18+
verbose: false
1919
},
20-
boolean: ['missing', 'extra', 'dev', 'version', 'ignore', 'default-entries', 'quiet'],
20+
boolean: ['missing', 'extra', 'dev', 'version', 'ignore', 'default-entries', 'verbose'],
2121
alias: {
2222
extra: 'unused',
2323
'ignore-module': 'i',
@@ -45,7 +45,7 @@ if (args.help || args._.length === 0) {
4545
console.log("--extensions, -e List of file extensions with detective to use when resolving require paths. Eg. 'js,jsx:detective-es6'")
4646
console.log('--version Show current version')
4747
console.log('--ignore To always exit with code 0 pass --ignore')
48-
console.log('--quiet To disable logging on success')
48+
console.log('--verbose Enable logging of success')
4949
console.log('')
5050

5151
process.exit(1)
@@ -96,7 +96,7 @@ check({
9696
failed += extras.length
9797
if (extras.length) {
9898
console.error('Fail! Modules in package.json not used in code: ' + extras.join(', '))
99-
} else if (!args.quiet) {
99+
} else if (args.verbose) {
100100
console.log('Success! All dependencies in package.json are used in the code')
101101
}
102102
}
@@ -105,7 +105,7 @@ check({
105105
failed += missing.length
106106
if (missing.length) {
107107
console.error('Fail! Dependencies not listed in package.json: ' + missing.join(', '))
108-
} else if (!args.quiet) {
108+
} else if (args.verbose) {
109109
console.log('Success! All dependencies used in the code are listed in package.json')
110110
}
111111
}

‎readme.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,21 @@ $ dependency-check <path to module file(s), package.json or module folder>
3232
3333
# e.g.
3434
35-
$ dependency-check ./package.json
35+
$ dependency-check ./package.json --verbose
3636
Success! All dependencies used in the code are listed in package.json
3737
Success! All dependencies in package.json are used in the code
38-
$ dependency-check ./package.json --missing
38+
$ dependency-check ./package.json --missing --verbose
3939
Success! All dependencies used in the code are listed in package.json
40-
$ dependency-check ./package.json --unused
40+
$ dependency-check ./package.json --unused --verbose
4141
Success! All dependencies in package.json are used in the code
4242
4343
# or with file input instead:
4444
4545
$ dependency-check ./index.js
46-
Success! All dependencies used in the code are listed in package.json
47-
Success! All dependencies in package.json are used in the code
4846
4947
# even with globs and multiple inputs:
5048
5149
$ dependency-check ./test/**/*.js ./lib/*.js
52-
Success! All dependencies used in the code are listed in package.json
53-
Success! All dependencies in package.json are used in the code
5450
```
5551

5652
`dependency-check` exits with code 1 if there are discrepancies, in addition to printing them out
@@ -105,9 +101,9 @@ running `dependency-check ./package.json -e js,jsx:precinct` will resolve requir
105101

106102
running `dependency-check ./package.json --detective precinct` will `require()` the local `precinct` as the default parser. This can be set per-extension using using `-e`. Defaults to parsing with [`detective`](https://www.npmjs.com/package/detective).
107103

108-
### --quiet
104+
### --verbose
109105

110-
Running with `--quiet` will diable the default log message on success, so that dependency-check only logs on failure.
106+
Running with `--verbose` will enable a log message on success, otherwise dependency-check only logs on failure.
111107

112108
### --help
113109

0 commit comments

Comments
 (0)
This repository has been archived.