Skip to content

Commit

Permalink
Other: Minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Jun 9, 2017
1 parent eb1b404 commit 114f7ea
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -586,27 +586,28 @@ Translates between file formats and generates static code.

-t, --target Specifies the target format. Also accepts a path to require a custom target.

json JSON representation
json-module JSON representation as a module
proto2 Protocol Buffers, Version 2
proto3 Protocol Buffers, Version 3
static Static code without reflection (non-functional on its own)
static-module Static code without reflection as a module
json JSON representation
json-module JSON representation as a module
proto2 Protocol Buffers, Version 2
proto3 Protocol Buffers, Version 3
static Static code without reflection (non-functional on its own)
static-module Static code without reflection as a module

-p, --path Adds a directory to the include path.

-o, --out Saves to a file instead of writing to stdout.

--sparse Exports only those types referenced from a main file (experimental).

Module targets only:
Module targets only:

-w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.

default Default wrapper supporting both CommonJS and AMD
commonjs CommonJS wrapper
amd AMD wrapper
es6 ES6 wrapper (implies --es6)
closure A closure adding to protobuf.roots where protobuf is a global

-r, --root Specifies an alternative protobuf.roots name.

Expand All @@ -616,11 +617,11 @@ Translates between file formats and generates static code.

--es6 Enables ES6 syntax (const/let instead of var)

Proto sources only:
Proto sources only:

--keep-case Keeps field casing instead of converting to camel case.

Static targets only:
Static targets only:

--no-create Does not generate create functions used for reflection compatibility.
--no-encode Does not generate encode functions.
Expand All @@ -634,7 +635,7 @@ Translates between file formats and generates static code.
--force-long Enfores the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.
--force-message Enfores the use of message instances instead of plain objects.

usage: pbjs [options] file1.proto file2.json ... (or) other | pbjs [options] -
usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] -
```
For production environments it is recommended to bundle all your .proto files to a single .json file, which minimizes the number of network requests and avoids any parser overhead (hint: works with just the **light** library):
Expand Down
12 changes: 6 additions & 6 deletions cli/pbjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ exports.main = function main(args, callback) {

if (!files.length) {
var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) {
return " " + util.pad(key, 14, true) + targets[key].description;
return " " + util.pad(key, 14, true) + targets[key].description;
});
if (callback)
callback(Error("usage")); // eslint-disable-line callback-return
Expand All @@ -89,15 +89,15 @@ exports.main = function main(args, callback) {
"",
" --sparse Exports only those types referenced from a main file (experimental).",
"",
chalk.bold.gray(" Module targets only:"),
chalk.bold.gray(" Module targets only:"),
"",
" -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.",
"",
" default Default wrapper supporting both CommonJS and AMD",
" commonjs CommonJS wrapper",
" amd AMD wrapper",
" es6 ES6 wrapper (implies --es6)",
" closure Just a closure adding to protobuf.roots (see -r)",
" closure A closure adding to protobuf.roots where protobuf is a global",
"",
" -r, --root Specifies an alternative protobuf.roots name.",
"",
Expand All @@ -107,11 +107,11 @@ exports.main = function main(args, callback) {
"",
" --es6 Enables ES6 syntax (const/let instead of var)",
"",
chalk.bold.gray(" Proto sources only:"),
chalk.bold.gray(" Proto sources only:"),
"",
" --keep-case Keeps field casing instead of converting to camel case.",
"",
chalk.bold.gray(" Static targets only:"),
chalk.bold.gray(" Static targets only:"),
"",
" --no-create Does not generate create functions used for reflection compatibility.",
" --no-encode Does not generate encode functions.",
Expand All @@ -125,7 +125,7 @@ exports.main = function main(args, callback) {
" --force-long Enfores the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.",
" --force-message Enfores the use of message instances instead of plain objects.",
"",
"usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..." + chalk.gray(" (or) ") + "other | " + chalk.bold.green("pbjs") + " [options] -",
"usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..." + chalk.gray(" (or pipe) ") + "other | " + chalk.bold.green("pbjs") + " [options] -",
""
].join("\n"));
return 1;
Expand Down
2 changes: 1 addition & 1 deletion cli/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function modExists(name, version) {
}

function modInstall(install) {
child_process.execSync("npm --silent --no-bin-links install " + (typeof install === "string" ? install : install.join(" ")), {
child_process.execSync("npm --silent install " + (typeof install === "string" ? install : install.join(" ")), {
cwd: __dirname,
stdio: "ignore"
});
Expand Down

0 comments on commit 114f7ea

Please sign in to comment.