Skip to content

Commit 114f7ea

Browse files
committed
Other: Minor formatting
1 parent eb1b404 commit 114f7ea

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

README.md

+11-10
Original file line numberDiff line numberDiff line change
@@ -586,27 +586,28 @@ Translates between file formats and generates static code.
586586
587587
-t, --target Specifies the target format. Also accepts a path to require a custom target.
588588
589-
json JSON representation
590-
json-module JSON representation as a module
591-
proto2 Protocol Buffers, Version 2
592-
proto3 Protocol Buffers, Version 3
593-
static Static code without reflection (non-functional on its own)
594-
static-module Static code without reflection as a module
589+
json JSON representation
590+
json-module JSON representation as a module
591+
proto2 Protocol Buffers, Version 2
592+
proto3 Protocol Buffers, Version 3
593+
static Static code without reflection (non-functional on its own)
594+
static-module Static code without reflection as a module
595595
596596
-p, --path Adds a directory to the include path.
597597
598598
-o, --out Saves to a file instead of writing to stdout.
599599
600600
--sparse Exports only those types referenced from a main file (experimental).
601601
602-
Module targets only:
602+
Module targets only:
603603
604604
-w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.
605605
606606
default Default wrapper supporting both CommonJS and AMD
607607
commonjs CommonJS wrapper
608608
amd AMD wrapper
609609
es6 ES6 wrapper (implies --es6)
610+
closure A closure adding to protobuf.roots where protobuf is a global
610611
611612
-r, --root Specifies an alternative protobuf.roots name.
612613
@@ -616,11 +617,11 @@ Translates between file formats and generates static code.
616617
617618
--es6 Enables ES6 syntax (const/let instead of var)
618619
619-
Proto sources only:
620+
Proto sources only:
620621
621622
--keep-case Keeps field casing instead of converting to camel case.
622623
623-
Static targets only:
624+
Static targets only:
624625
625626
--no-create Does not generate create functions used for reflection compatibility.
626627
--no-encode Does not generate encode functions.
@@ -634,7 +635,7 @@ Translates between file formats and generates static code.
634635
--force-long Enfores the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.
635636
--force-message Enfores the use of message instances instead of plain objects.
636637
637-
usage: pbjs [options] file1.proto file2.json ... (or) other | pbjs [options] -
638+
usage: pbjs [options] file1.proto file2.json ... (or pipe) other | pbjs [options] -
638639
```
639640

640641
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):

cli/pbjs.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ exports.main = function main(args, callback) {
6969

7070
if (!files.length) {
7171
var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) {
72-
return " " + util.pad(key, 14, true) + targets[key].description;
72+
return " " + util.pad(key, 14, true) + targets[key].description;
7373
});
7474
if (callback)
7575
callback(Error("usage")); // eslint-disable-line callback-return
@@ -89,15 +89,15 @@ exports.main = function main(args, callback) {
8989
"",
9090
" --sparse Exports only those types referenced from a main file (experimental).",
9191
"",
92-
chalk.bold.gray(" Module targets only:"),
92+
chalk.bold.gray(" Module targets only:"),
9393
"",
9494
" -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper.",
9595
"",
9696
" default Default wrapper supporting both CommonJS and AMD",
9797
" commonjs CommonJS wrapper",
9898
" amd AMD wrapper",
9999
" es6 ES6 wrapper (implies --es6)",
100-
" closure Just a closure adding to protobuf.roots (see -r)",
100+
" closure A closure adding to protobuf.roots where protobuf is a global",
101101
"",
102102
" -r, --root Specifies an alternative protobuf.roots name.",
103103
"",
@@ -107,11 +107,11 @@ exports.main = function main(args, callback) {
107107
"",
108108
" --es6 Enables ES6 syntax (const/let instead of var)",
109109
"",
110-
chalk.bold.gray(" Proto sources only:"),
110+
chalk.bold.gray(" Proto sources only:"),
111111
"",
112112
" --keep-case Keeps field casing instead of converting to camel case.",
113113
"",
114-
chalk.bold.gray(" Static targets only:"),
114+
chalk.bold.gray(" Static targets only:"),
115115
"",
116116
" --no-create Does not generate create functions used for reflection compatibility.",
117117
" --no-encode Does not generate encode functions.",
@@ -125,7 +125,7 @@ exports.main = function main(args, callback) {
125125
" --force-long Enfores the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.",
126126
" --force-message Enfores the use of message instances instead of plain objects.",
127127
"",
128-
"usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..." + chalk.gray(" (or) ") + "other | " + chalk.bold.green("pbjs") + " [options] -",
128+
"usage: " + chalk.bold.green("pbjs") + " [options] file1.proto file2.json ..." + chalk.gray(" (or pipe) ") + "other | " + chalk.bold.green("pbjs") + " [options] -",
129129
""
130130
].join("\n"));
131131
return 1;

cli/util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function modExists(name, version) {
126126
}
127127

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

0 commit comments

Comments
 (0)