Skip to content

Commit

Permalink
6.2.0 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 15, 2016
1 parent fb74223 commit b40c86a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 41 deletions.
61 changes: 31 additions & 30 deletions cli/pbjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,39 @@ exports.main = function(args, callback) {
var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) {
return " " + util.pad(key, 14, true) + targets[key].description;
});
console.log([
"protobuf.js v" + pkg.version + " cli",
"",
"Consolidates imports and converts between file formats.",
"",
" -t, --target Specifies the target format. Also accepts a path to require a custom target.",
"",
descs.join('\n'),
"",
" -p, --path Adds a directory to the include path.",
"",
" -o, --out Saves to a file instead of writing to stdout.",
"",
" -w, --wrap Specifies the wrapper to use for *-module targets. Also accepts a path.",
"",
" default Default wrapper supporting both CommonJS and AMD",
" commonjs CommonJS only wrapper",
" amd AMD only wrapper",
"",
" -r, --root Specifies an alternative protobuf.roots name for *-module targets.",
"",
" Static code generation only:",
"",
" --no-encode Does not generate encode functions.",
" --no-decode Does not generate decode functions.",
" --no-verify Does not generate verify functions.",
" --no-delimited Does not generate delimited encode/decode functions.",
"",
"usage: " + chalk.bold.green(path.basename(process.argv[1])) + " [options] file1.proto file2.json ..."
].join("\n"));
if (callback)
callback(Error("usage"));
else
console.error([
"protobuf.js v" + pkg.version + " cli",
"",
"Consolidates imports and converts between file formats.",
"",
" -t, --target Specifies the target format. Also accepts a path to require a custom target.",
"",
descs.join('\n'),
"",
" -p, --path Adds a directory to the include path.",
"",
" -o, --out Saves to a file instead of writing to stdout.",
"",
" -w, --wrap Specifies the wrapper to use for *-module targets. Also accepts a path.",
"",
" default Default wrapper supporting both CommonJS and AMD",
" commonjs CommonJS only wrapper",
" amd AMD only wrapper",
"",
" -r, --root Specifies an alternative protobuf.roots name for *-module targets.",
"",
" Static code generation only:",
"",
" --no-encode Does not generate encode functions.",
" --no-decode Does not generate decode functions.",
" --no-verify Does not generate verify functions.",
" --no-delimited Does not generate delimited encode/decode functions.",
"",
"usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..."
].join("\n"));
return 1;
}

Expand Down
25 changes: 14 additions & 11 deletions cli/pbts.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@ exports.main = function(args, callback) {
var files = argv._;

if (!files.length) {
console.log([
"protobuf.js v" + pkg.version + " cli for TypeScript",
"",
"Generates TypeScript definitions from annotated JavaScript files.",
"",
" -n, --name Wraps everything in a module of the specified name.",
"",
" -o, --out Saves to a file instead of writing to stdout.",
"",
"usage: " + chalk.bold.green(path.basename(process.argv[1])) + " [options] file1.js file2.js ..."
].join("\n"));
if (callback)
callback(Error("usage"));
else
console.error([
"protobuf.js v" + pkg.version + " cli for TypeScript",
"",
"Generates TypeScript definitions from annotated JavaScript files.",
"",
" -n, --name Wraps everything in a module of the specified name.",
"",
" -o, --out Saves to a file instead of writing to stdout.",
"",
"usage: " + chalk.bold.green("pbts") + " [options] file1.js file2.js ..."
].join("\n"));
if (callback)
callback(Error("usage"));
return 1;
Expand Down

0 comments on commit b40c86a

Please sign in to comment.