Skip to content

Commit

Permalink
CLI: Expose tsd-jsdoc's comments option to pbts as --no-comments, see #…
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 27, 2016
1 parent 6fe0992 commit e8a4d53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
```

Expand Down
10 changes: 8 additions & 2 deletions cli/pbts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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._;
Expand All @@ -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)
Expand All @@ -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",
Expand Down

0 comments on commit e8a4d53

Please sign in to comment.