Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add alt-comment CLI option #1692

Merged
merged 1 commit into from Jul 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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