Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #26 from gregglind/quiet25

added quiet mode #25
  • Loading branch information...
commit 5e02f8b8e00dcb6adf46aed73d6435b099854415 2 parents cdb7737 + f2e1de3
@zaach authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/cli.js
View
10 lib/cli.js
@@ -48,6 +48,12 @@ var options = require("nomnom")
string: '-e, --environment',
"default": "json-schema-draft-03",
help: 'which specification of JSON Schema the validation file uses'
+ },
+ quiet: {
+ flag: true,key: "value",
+ string: '-q, --quiet',
+ "default": false,
+ help : 'do not print the parsed json to STDOUT'
}
}).parse();
@@ -100,7 +106,7 @@ function main (args) {
if (options.inplace) {
fs.writeSync(fs.openSync(path,'w+'), source, 0, "utf8");
} else {
- console.log(source);
+ if (! options.quiet) { console.log(source)};
}
} else {
var stdin = process.openStdin();
@@ -110,7 +116,7 @@ function main (args) {
source += chunk.toString('utf8');
});
stdin.on('end', function () {
- console.log(parse(source));
+ if (! options.quiet) {console.log(parse(source))};
});
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.