22var path = require ( "path" ) ,
33 fs = require ( "fs" ) ,
44 minimist = require ( "minimist" ) ,
5- chalk = require ( "chalk" ) ,
65 pkg = require ( "./package.json" ) ,
76 util = require ( "./util" ) ,
87 glob = require ( "glob" ) ,
98 protobuf = require ( "protobufjs" ) ;
109
1110var targets = util . requireAll ( "./targets" ) ;
11+ var color = util . color ;
1212
1313var lintDefault = "eslint-disable " + [
1414 "block-scoped-var" ,
@@ -234,7 +234,7 @@ exports.main = function main(args, callback) {
234234 process . stderr . write ( [
235235 "protobuf.js v" + pkg . version + " CLI for JavaScript" ,
236236 "" ,
237- chalk . bold . white ( "Translates between file formats and generates static code." ) ,
237+ color . bold + color . white + "Translates between file formats and generates static code." + color . reset ,
238238 "" ,
239239 " -t, --target Specifies the target format. Also accepts a path to require a custom target." ,
240240 "" ,
@@ -251,7 +251,7 @@ exports.main = function main(args, callback) {
251251 "" ,
252252 " --sparse Exports only those types referenced from a main file (experimental)." ,
253253 "" ,
254- chalk . bold . gray ( " Module targets only:" ) ,
254+ color . bold + color . gray + " Module targets only:" + color . reset ,
255255 "" ,
256256 " -w, --wrap Specifies the wrapper to use. Also accepts a path to require a custom wrapper." ,
257257 "" ,
@@ -271,12 +271,12 @@ exports.main = function main(args, callback) {
271271 "" ,
272272 " --es6 Enables ES6 syntax (const/let instead of var)" ,
273273 "" ,
274- chalk . bold . gray ( " Proto sources only:" ) ,
274+ color . bold + color . gray + " Proto sources only:" + color . reset ,
275275 "" ,
276276 " --keep-case Keeps field casing instead of converting to camel case." ,
277277 " --alt-comment Turns on an alternate comment parsing mode that preserves more comments." ,
278278 "" ,
279- chalk . bold . gray ( " Static targets only:" ) ,
279+ color . bold + color . gray + " Static targets only:" + color . reset ,
280280 "" ,
281281 " --no-create Does not generate create functions used for reflection compatibility." ,
282282 " --no-encode Does not generate encode functions." ,
@@ -296,7 +296,7 @@ exports.main = function main(args, callback) {
296296 " --null-defaults Default value for optional fields is null instead of zero value." ,
297297 " --null-semantics Make nullable fields match protobuf semantics (overrides --null-defaults)." ,
298298 "" ,
299- "usage: " + chalk . bold . green ( "pbjs" ) + " [options] file1.proto file2.json ..." + chalk . gray ( " (or pipe) " ) + "other | " + chalk . bold . green ( "pbjs" ) + " [options] -" ,
299+ "usage: " + color . bold + color . green + "pbjs" + color . reset + " [options] file1.proto file2.json ..." + color . gray + " (or pipe) " + color . reset + "other | " + color . bold + color . green + "pbjs" + color . reset + " [options] -" ,
300300 ""
301301 ] . join ( "\n" ) ) ;
302302 return 1 ;
0 commit comments