From 114f7ea9fa3813003afc3ebb453b2dd2262808e1 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Fri, 9 Jun 2017 10:04:01 +0200 Subject: [PATCH] Other: Minor formatting --- README.md | 21 +++++++++++---------- cli/pbjs.js | 12 ++++++------ cli/util.js | 2 +- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 5dd18fb95..9bcae3489 100644 --- a/README.md +++ b/README.md @@ -586,12 +586,12 @@ 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. @@ -599,7 +599,7 @@ Translates between file formats and generates static code. --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. @@ -607,6 +607,7 @@ Translates between file formats and generates static code. 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. @@ -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. @@ -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): diff --git a/cli/pbjs.js b/cli/pbjs.js index af74d931a..17f8fd3a0 100644 --- a/cli/pbjs.js +++ b/cli/pbjs.js @@ -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 @@ -89,7 +89,7 @@ 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.", "", @@ -97,7 +97,7 @@ exports.main = function main(args, callback) { " 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.", "", @@ -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.", @@ -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; diff --git a/cli/util.js b/cli/util.js index 402bf892c..605f4263d 100644 --- a/cli/util.js +++ b/cli/util.js @@ -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" });