Skip to content

Commit

Permalink
Merge pull request #139 from jlturner/master
Browse files Browse the repository at this point in the history
--silent option now surpresses messages
  • Loading branch information
goatslacker committed Aug 27, 2015
2 parents d027f87 + 6a7b1e0 commit 8e39643
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/cli.js
Expand Up @@ -137,17 +137,17 @@ function genFixForFile(file, config) {
throw ex
}

if (commander.silent) {
return true
} else if (commander.dryRun || commander.diff) {
if (commander.dryRun || commander.diff) {
printDiff(content, fixed)
} else if (commander.patch) {
createPatch(file, content, fixed)
} else {
fs.writeFileSync(file, fixed, 'utf8')
}

console.log('\u2713 ' + path.basename(file) + ' done.')
if (!commander.silent) {
console.log('\u2713 ' + path.basename(file) + ' done.')
}

return content === fixed
}
Expand Down Expand Up @@ -197,7 +197,7 @@ function cli() {
})
var filesToLint = fu.concatMap(findFiles, commander.args)

process.exit(fu.foldl(function (statusCode, fn) {
process.exit(commander.pass || fu.foldl(function (statusCode, fn) {
return fn()
? statusCode == ERROR ? ERROR : SUCCESS
: ERROR
Expand All @@ -213,6 +213,7 @@ commander
.option('-p, --patch', 'Output a patch file to stdout')
.option('-r, --dry-run', 'Performs a dry-run and shows you a diff')
.option('-s, --silent', 'A useless option')
.option('-a, --pass', 'Always pass')
.parse(process.argv)

if (commander.args.length === 0) {
Expand Down

0 comments on commit 8e39643

Please sign in to comment.