Skip to content

Commit

Permalink
feat: add alt-comment CLI option (#1692)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngg committed Jul 8, 2022
1 parent d9144de commit 7558ef0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/pbjs.js
Expand Up @@ -41,7 +41,7 @@ exports.main = function main(args, callback) {
"force-message": "strict-message"
},
string: [ "target", "out", "path", "wrap", "dependency", "root", "lint" ],
boolean: [ "create", "encode", "decode", "verify", "convert", "delimited", "typeurl", "beautify", "comments", "service", "es6", "sparse", "keep-case", "force-long", "force-number", "force-enum-string", "force-message", "null-defaults" ],
boolean: [ "create", "encode", "decode", "verify", "convert", "delimited", "typeurl", "beautify", "comments", "service", "es6", "sparse", "keep-case", "alt-comment", "force-long", "force-number", "force-enum-string", "force-message", "null-defaults" ],
default: {
target: "json",
create: true,
Expand All @@ -57,6 +57,7 @@ exports.main = function main(args, callback) {
es6: null,
lint: lintDefault,
"keep-case": false,
"alt-comment": false,
"force-long": false,
"force-number": false,
"force-enum-string": false,
Expand Down Expand Up @@ -124,6 +125,7 @@ exports.main = function main(args, callback) {
chalk.bold.gray(" Proto sources only:"),
"",
" --keep-case Keeps field casing instead of converting to camel case.",
" --alt-comment Turns on an alternate comment parsing mode that preserves more comments.",
"",
chalk.bold.gray(" Static targets only:"),
"",
Expand Down Expand Up @@ -204,7 +206,8 @@ exports.main = function main(args, callback) {
}

var parseOptions = {
"keepCase": argv["keep-case"] || false
"keepCase": argv["keep-case"] || false,
"alternateCommentMode": argv["alt-comment"] || false,
};

// Read from stdin
Expand Down

0 comments on commit 7558ef0

Please sign in to comment.