Permalink
Browse files

CLI: Expose tsd-jsdoc's comments option to pbts as --no-comments, see #…

  • Loading branch information...
dcodeIO committed Dec 27, 2016
1 parent 6fe0992 commit e8a4d5373b1a00cc6eafa5b201b91d0e250cc00b
Showing with 10 additions and 2 deletions.
  1. +2 −0 README.md
  2. +8 −2 cli/pbts.js
@@ -395,6 +395,8 @@ Generates TypeScript definitions from annotated JavaScript files.
-o, --out Saves to a file instead of writing to stdout.
--no-comments Does not output any JSDoc comments.
usage: pbts [options] file1.js file2.js ...
```
@@ -24,7 +24,11 @@ exports.main = function(args, callback) {
name: "n",
out : "o"
},
string: [ "name", "out" ]
string: [ "name", "out" ],
boolean: [ "comments" ],
default: {
comments: true
}
});
var files = argv._;
@@ -42,6 +46,8 @@ exports.main = function(args, callback) {
"",
" -o, --out Saves to a file instead of writing to stdout.",
"",
" --no-comments Does not output any JSDoc comments.",
"",
"usage: " + chalk.bold.green("pbts") + " [options] file1.js file2.js ..."
].join("\n"));
if (callback)
@@ -62,7 +68,7 @@ exports.main = function(args, callback) {
// There is no proper API for jsdoc, so this executes the CLI and pipes the output
var basedir = path.join(__dirname, "..");
var moduleName = argv.name || "null";
var child = child_process.exec("node \"" + basedir + "/node_modules/jsdoc/jsdoc.js\" -c \"" + basedir + "/jsdoc.types.json\" -q \"module=" + encodeURIComponent(moduleName) + "\" " + files.map(function(file) { return '"' + file + '"'; }).join(' '), {
var child = child_process.exec("node \"" + basedir + "/node_modules/jsdoc/jsdoc.js\" -c \"" + basedir + "/jsdoc.types.json\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return '"' + file + '"'; }).join(' '), {
cwd: process.cwd(),
argv0: "node",
stdio: "pipe",

0 comments on commit e8a4d53

Please sign in to comment.