massarg 1.0.1 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/assertions.js CHANGED
@@ -30,10 +30,14 @@ var __read = (this && this.__read) || function (o, n) {
30
30
  }
31
31
  return ar;
32
32
  };
33
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
34
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
35
- to[j] = from[i];
36
- return to;
33
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
34
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
35
+ if (ar || !(i in from)) {
36
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
37
+ ar[i] = from[i];
38
+ }
39
+ }
40
+ return to.concat(ar || Array.prototype.slice.call(from));
37
41
  };
38
42
  Object.defineProperty(exports, "__esModule", { value: true });
39
43
  exports.assertMain = exports.assertExample = exports.assertOption = exports.assertCommand = exports.assertHelp = exports.colorList = void 0;
@@ -60,7 +64,7 @@ function nullOr(condition, condition2) {
60
64
  return [null, undefined].includes(condition) || condition2;
61
65
  }
62
66
  function assertRequired(obj, prefix, name) {
63
- assert(![undefined, null].includes(obj), prefix + ": " + name + " must be provided");
67
+ assert(![undefined, null].includes(obj), "".concat(prefix, ": ").concat(name, " must be provided"));
64
68
  }
65
69
  function assertType(obj, prefix, name, options) {
66
70
  if (options.required) {
@@ -74,7 +78,7 @@ function assertType(obj, prefix, name, options) {
74
78
  return;
75
79
  }
76
80
  }
77
- assert(typeof obj === options.type, prefix + ": " + name + " must be " + options.type);
81
+ assert(typeof obj === options.type, "".concat(prefix, ": ").concat(name, " must be ").concat(options.type));
78
82
  }
79
83
  function assertNumber(obj, prefix, name, options) {
80
84
  assertType(obj, prefix, name, { required: options.required, type: "number" });
@@ -82,17 +86,17 @@ function assertNumber(obj, prefix, name, options) {
82
86
  return;
83
87
  }
84
88
  if (typeof options.max === "number") {
85
- assert(obj <= options.max, prefix + ": " + name + " must be \u2264 " + options.max);
89
+ assert(obj <= options.max, "".concat(prefix, ": ").concat(name, " must be \u2264 ").concat(options.max));
86
90
  }
87
91
  if (typeof options.min === "number") {
88
- assert(obj >= options.min, prefix + ": " + name + " must be \u2265 " + options.min);
92
+ assert(obj >= options.min, "".concat(prefix, ": ").concat(name, " must be \u2265 ").concat(options.min));
89
93
  }
90
94
  }
91
95
  function assertColor(color, prefix, name) {
92
- assert(nullOr(color, utils_1.asArray(color).every(function (c) { return exports.colorList.includes(c); })), prefix + ": " + name + " must be string or array of strings. Accepted values: " + exports.colorList.join(", "));
96
+ assert(nullOr(color, (0, utils_1.asArray)(color).every(function (c) { return exports.colorList.includes(c); })), "".concat(prefix, ": ").concat(name, " must be string or array of strings. Accepted values: ") + exports.colorList.join(", "));
93
97
  }
94
98
  function assertAliases(def, allDefs, prefix) {
95
- assert(!def.aliases || def.aliases.every(function (a) { return !allDefs.find(function (opt) { var _a; return __spreadArray([opt.name], __read(((_a = opt.aliases) !== null && _a !== void 0 ? _a : []))).includes(a); }); }), prefix + ": Aliases must be unique");
99
+ assert(!def.aliases || def.aliases.every(function (a) { return !allDefs.find(function (opt) { var _a; return __spreadArray([opt.name], __read(((_a = opt.aliases) !== null && _a !== void 0 ? _a : [])), false).includes(a); }); }), "".concat(prefix, ": Aliases must be unique"));
96
100
  }
97
101
  function assertHelp(help) {
98
102
  assertType(help.binName, "Help", "Binary Name", { type: "string" });
package/assertions.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"assertions.js","sourceRoot":"","sources":["../src/assertions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iCAA0C;AAE1C,kBAAkB;AACL,QAAA,SAAS,GAAG;IACvB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO;I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A+B,CAAC,CAAA;IACpD,MAAM,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,6BAA6B,CAAC,CAAA;IACtE,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;IAC3C,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;IAC1E,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;AACnE,CAAC;AAND,oCAMC;AAED,SAAgB,aAAa,CAAC,OAAmB;IAC/C,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IACjF,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IACnE,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;AAC/E,CAAC;AAJD,sCAIC;AAED,SAAgB,UAAU,CAAC,GAAiB;IAC1C,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA;AACvE,CAAC;AAFD,gCAEC"}
package/errors.d.ts CHANGED
@@ -2,5 +2,6 @@ export declare class RequiredError extends Error {
2
2
  fieldName: string;
3
3
  cmdName: string;
4
4
  constructor(fieldName: string, cmdName: string);
5
+ static isRequiredError(e: any): e is RequiredError;
5
6
  }
6
7
  //# sourceMappingURL=errors.d.ts.map
package/errors.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAS,EAAG,MAAM,CAAA;IAClB,OAAO,EAAG,MAAM,CAAA;gBAEJ,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAS/C"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAS,EAAG,MAAM,CAAA;IAClB,OAAO,EAAG,MAAM,CAAA;gBAEJ,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;WAUhC,eAAe,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,aAAa;CAG1D"}
package/errors.js CHANGED
@@ -19,11 +19,14 @@ exports.RequiredError = void 0;
19
19
  var RequiredError = /** @class */ (function (_super) {
20
20
  __extends(RequiredError, _super);
21
21
  function RequiredError(fieldName, cmdName) {
22
- var _this = _super.call(this, "Option: `" + fieldName + "` is required" + (cmdName !== "all" ? " for command: `" + cmdName + "`" : "") + ", but was not defined. Try using: `--" + fieldName + " {value}`") || this;
22
+ var _this = _super.call(this, "Option: `".concat(fieldName, "` is required").concat(cmdName !== "all" ? " for command: `".concat(cmdName, "`") : "", ", but was not defined. Try using: `--").concat(fieldName, " {value}`")) || this;
23
23
  _this.fieldName = fieldName;
24
24
  _this.cmdName = cmdName;
25
25
  return _this;
26
26
  }
27
+ RequiredError.isRequiredError = function (e) {
28
+ return e.fieldName && e.cmdName;
29
+ };
27
30
  return RequiredError;
28
31
  }(Error));
29
32
  exports.RequiredError = RequiredError;
package/errors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;IAAmC,iCAAK;IAItC,uBAAY,SAAiB,EAAE,OAAe;QAA9C,YACE,kBACE,cAAa,SAAS,sBACpB,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,oBAAmB,OAAO,MAAI,CAAC,CAAC,CAAC,EAAE,8CAChB,SAAS,cAAY,CAC/D,SAGF;QAFC,KAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,KAAI,CAAC,OAAO,GAAG,OAAO,CAAA;;IACxB,CAAC;IACH,oBAAC;AAAD,CAAC,AAbD,CAAmC,KAAK,GAavC;AAbY,sCAAa"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;IAAmC,iCAAK;IAItC,uBAAY,SAAiB,EAAE,OAAe;QAA9C,YACE,kBACE,mBAAa,SAAS,0BACpB,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,yBAAmB,OAAO,MAAI,CAAC,CAAC,CAAC,EAAE,kDAChB,SAAS,cAAY,CAC/D,SAGF;QAFC,KAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,KAAI,CAAC,OAAO,GAAG,OAAO,CAAA;;IACxB,CAAC;IAEa,6BAAe,GAA7B,UAA8B,CAAM;QAClC,OAAO,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,OAAO,CAAA;IACjC,CAAC;IACH,oBAAC;AAAD,CAAC,AAjBD,CAAmC,KAAK,GAiBvC;AAjBY,sCAAa"}
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare class Massarg<Options> {
9
9
  private _maxNameLen;
10
10
  /**
11
11
  * These are the parsed options passed via args. They will only be available after using `parse()` or `printHelp()`,
12
- * or when retured by `parseArgs()`. */
12
+ * or when returned by `parseArgs()`. */
13
13
  data: Options & OptionsBase;
14
14
  private _help;
15
15
  private _requiredOptions;
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,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AO,CAAC,OAAO,CAAC;IAqBzE,qDAAqD;IAC9C,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAOrD,4BAA4B;IACrB,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAU9D,uDAAuD;IAChD,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAO5C;;;;OAIG;IACI,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI;IAIvC;;;OAGG;IACI,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IA8C/C;;;;;OAKG;IACI,SAAS,CAAC,IAAI,WAAe,GAAG,OAAO,GAAG,WAAW;IA4D5D;;;;OAIG;IACI,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI;IA4BnC,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,cAAc;IAkDtB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,gBAAgB;IA+BxB,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,gBAAgB;IA8CxB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,aAAa;IA+CrB,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,UAAU;CAMnB;AAED,wBAAgB,OAAO,CAAC,CAAC,gBAExB;AAED,eAAe,OAAO,CAAA"}
package/index.js CHANGED
@@ -31,10 +31,14 @@ var __read = (this && this.__read) || function (o, n) {
31
31
  }
32
32
  return ar;
33
33
  };
34
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
35
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
36
- to[j] = from[i];
37
- return to;
34
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
35
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
36
+ if (ar || !(i in from)) {
37
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
38
+ ar[i] = from[i];
39
+ }
40
+ }
41
+ return to.concat(ar || Array.prototype.slice.call(from));
38
42
  };
39
43
  var __importDefault = (this && this.__importDefault) || function (mod) {
40
44
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -56,7 +60,7 @@ var Massarg = /** @class */ (function () {
56
60
  this._maxNameLen = 0;
57
61
  /**
58
62
  * These are the parsed options passed via args. They will only be available after using `parse()` or `printHelp()`,
59
- * or when retured by `parseArgs()`. */
63
+ * or when returned by `parseArgs()`. */
60
64
  this.data = { help: false, extras: [] };
61
65
  this._help = {
62
66
  binName: undefined,
@@ -87,7 +91,7 @@ var Massarg = /** @class */ (function () {
87
91
  }
88
92
  /** Define the main command to run when no commands are passed. */
89
93
  Massarg.prototype.main = function (run) {
90
- assertions_1.assertMain(run);
94
+ (0, assertions_1.assertMain)(run);
91
95
  this._main = run;
92
96
  return this;
93
97
  };
@@ -101,7 +105,7 @@ var Massarg = /** @class */ (function () {
101
105
  (_b = option.array) !== null && _b !== void 0 ? _b : (option.array = Array.isArray(defaultValue));
102
106
  // default parser
103
107
  (_e = option.parse) !== null && _e !== void 0 ? _e : (option.parse = (option.boolean ? this._isTruthy : function (a) { return a; }));
104
- assertions_1.assertOption(option, this._options);
108
+ (0, assertions_1.assertOption)(option, this._options);
105
109
  if (option.array && defaultValue === undefined) {
106
110
  defaultValue = [];
107
111
  }
@@ -111,14 +115,14 @@ var Massarg = /** @class */ (function () {
111
115
  };
112
116
  /** Add example line to be added to the help text. */
113
117
  Massarg.prototype.example = function (example) {
114
- assertions_1.assertExample(example);
118
+ (0, assertions_1.assertExample)(example);
115
119
  this._examples.push(example);
116
120
  return this;
117
121
  };
118
122
  /** Add command to be run */
119
123
  Massarg.prototype.command = function (command) {
120
124
  var e_1, _a;
121
- assertions_1.assertCommand(command, this._commands);
125
+ (0, assertions_1.assertCommand)(command, this._commands);
122
126
  this._commands.push(command);
123
127
  try {
124
128
  for (var _b = __values(this._commandOptions(command)), _e = _b.next(); !_e.done; _e = _b.next()) {
@@ -137,8 +141,8 @@ var Massarg = /** @class */ (function () {
137
141
  };
138
142
  /** Set options for behavior of the help text print. */
139
143
  Massarg.prototype.help = function (help) {
140
- assertions_1.assertHelp(help);
141
- this._help = merge_1.default(this._help, help);
144
+ (0, assertions_1.assertHelp)(help);
145
+ this._help = (0, merge_1.default)(this._help, help);
142
146
  return this;
143
147
  };
144
148
  /**
@@ -172,13 +176,13 @@ var Massarg = /** @class */ (function () {
172
176
  if (this._commands.length) {
173
177
  lines.push(this.color(titleColors, "Commands:"));
174
178
  lines.push("");
175
- lines.push.apply(lines, __spreadArray([], __read(this._printCommands())));
179
+ lines.push.apply(lines, __spreadArray([], __read(this._printCommands()), false));
176
180
  }
177
- lines.push.apply(lines, __spreadArray([], __read(this._printOptions())));
181
+ lines.push.apply(lines, __spreadArray([], __read(this._printOptions()), false));
178
182
  if (this._examples.length) {
179
183
  lines.push(this.color(titleColors, "Examples:"));
180
184
  lines.push("");
181
- lines.push.apply(lines, __spreadArray([], __read(this._printExamples())));
185
+ lines.push.apply(lines, __spreadArray([], __read(this._printExamples()), false));
182
186
  }
183
187
  if (this._help.footer) {
184
188
  lines.push(this.color(bodyColors, this._help.footer));
@@ -216,7 +220,7 @@ var Massarg = /** @class */ (function () {
216
220
  var _loop_1 = function (i) {
217
221
  var e_3, _f;
218
222
  var arg = args[i];
219
- var option = this_1._options.find(function (o) { var _a; return "--" + o.name === arg || ((_a = o.aliases) === null || _a === void 0 ? void 0 : _a.map(function (a) { return "-" + a; }).includes(arg)); });
223
+ var option = this_1._options.find(function (o) { var _a; return "--".concat(o.name) === arg || ((_a = o.aliases) === null || _a === void 0 ? void 0 : _a.map(function (a) { return "-".concat(a); }).includes(arg)); });
220
224
  if (option) {
221
225
  var tempValue = void 0;
222
226
  var hasNextToken = args.length > i + 1;
@@ -227,7 +231,7 @@ var Massarg = /** @class */ (function () {
227
231
  }
228
232
  else if (!hasNextToken || !nextTokenIsValue) {
229
233
  // non-boolean args with no value
230
- throw new TypeError("Missing value for: " + option.name);
234
+ throw new TypeError("Missing value for: ".concat(option.name));
231
235
  }
232
236
  else {
233
237
  // any args (incl. boolean) with value
@@ -236,16 +240,17 @@ var Massarg = /** @class */ (function () {
236
240
  }
237
241
  var value = option.parse(tempValue, this_1.data);
238
242
  this_1._addOptionToData(option, value);
239
- return "continue";
243
+ // continue
240
244
  }
241
245
  var command = this_1._commands.find(function (o) { var _a; return o.name === arg || ((_a = o.aliases) === null || _a === void 0 ? void 0 : _a.includes(arg)); });
246
+ var justFoundCommand = false;
242
247
  if (command) {
243
- if (this_1._runCommand) {
244
- return "continue";
248
+ if (!this_1._runCommand) {
249
+ this_1._runCommand = command;
250
+ justFoundCommand = true;
245
251
  }
246
- this_1._runCommand = command;
247
252
  }
248
- if (!option && !command) {
253
+ if (!option && (!command || (command && !justFoundCommand))) {
249
254
  var defOpts = this_1._options.filter(function (o) { return o.isDefault; });
250
255
  if (defOpts.length) {
251
256
  try {
@@ -298,10 +303,9 @@ var Massarg = /** @class */ (function () {
298
303
  }
299
304
  }
300
305
  catch (e) {
301
- if (e.cmdName && e.fieldName) {
302
- console.log();
303
- console.error("Error");
306
+ if (errors_1.RequiredError.isRequiredError(e)) {
304
307
  console.error(chalk_1.default.red(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", ""], ["", ""])), e.message));
308
+ process.exit(1);
305
309
  }
306
310
  throw e;
307
311
  }
@@ -342,28 +346,28 @@ var Massarg = /** @class */ (function () {
342
346
  for (var _e = __values(this._examples), _f = _e.next(); !_f.done; _f = _e.next()) {
343
347
  var example = _f.value;
344
348
  if (example.description) {
345
- lines.push.apply(lines, __spreadArray([], __read(utils_1.wrap(this.color(titleColors, example.description), {
349
+ lines.push.apply(lines, __spreadArray([], __read((0, utils_1.wrap)(this.color(titleColors, example.description), {
346
350
  colorCount: this.colorCount(titleColors),
347
351
  indent: 2,
348
352
  printWidth: this._help.printWidth,
349
- }))));
353
+ })), false));
350
354
  lines.push("");
351
355
  }
352
- lines.push.apply(lines, __spreadArray([], __read(utils_1.wrap([this.color(normalColors, this._help.exampleInputPrefix), this.color(highlightColors, example.input)].join(" "), {
356
+ lines.push.apply(lines, __spreadArray([], __read((0, utils_1.wrap)([this.color(normalColors, this._help.exampleInputPrefix), this.color(highlightColors, example.input)].join(" "), {
353
357
  colorCount: this.colorCount(highlightColors),
354
358
  firstLineIndent: 2,
355
359
  indent: 3 + this._help.exampleInputPrefix.length,
356
360
  // indent: this.colorCount(normalColors) + 4,
357
361
  printWidth: this._help.printWidth,
358
- }))));
362
+ })), false));
359
363
  if (example.output) {
360
- lines.push.apply(lines, __spreadArray([], __read(utils_1.wrap([this.color(normalColors, this._help.exampleOutputPrefix), this.color(bodyColors, example.output)].join(" "), {
364
+ lines.push.apply(lines, __spreadArray([], __read((0, utils_1.wrap)([this.color(normalColors, this._help.exampleOutputPrefix), this.color(bodyColors, example.output)].join(" "), {
361
365
  colorCount: this.colorCount(bodyColors),
362
366
  firstLineIndent: 2,
363
367
  indent: 3 + this._help.exampleOutputPrefix.length,
364
368
  // indent: this.colorCount(normalColors) + 4,
365
369
  printWidth: this._help.printWidth,
366
- }))));
370
+ })), false));
367
371
  }
368
372
  lines.push("");
369
373
  }
@@ -396,7 +400,7 @@ var Massarg = /** @class */ (function () {
396
400
  var set = function (value) {
397
401
  var _a;
398
402
  _d[option.name] = value;
399
- _d[camelCase_1.default(option.name)] = value;
403
+ _d[(0, camelCase_1.default)(option.name)] = value;
400
404
  (_a = option.aliases) === null || _a === void 0 ? void 0 : _a.forEach(function (a) { return (_d[a] = value); });
401
405
  };
402
406
  var push = function (value) {
@@ -437,14 +441,14 @@ var Massarg = /** @class */ (function () {
437
441
  var _a, _b, _e, _f;
438
442
  var _g, _h;
439
443
  var _d = this.data;
440
- var ccSame = camelCase_1.default(option.name) === option.name;
444
+ var ccSame = (0, camelCase_1.default)(option.name) === option.name;
441
445
  (_a = _d[_g = option.name]) !== null && _a !== void 0 ? _a : (_d[_g] = []);
442
- (_b = _d[_h = camelCase_1.default(option.name)]) !== null && _b !== void 0 ? _b : (_d[_h] = []);
446
+ (_b = _d[_h = (0, camelCase_1.default)(option.name)]) !== null && _b !== void 0 ? _b : (_d[_h] = []);
443
447
  (_e = option.aliases) === null || _e === void 0 ? void 0 : _e.forEach(function (a) { var _a; return ((_a = _d[a]) !== null && _a !== void 0 ? _a : (_d[a] = [])); });
444
448
  if (value !== undefined) {
445
449
  _d[option.name].push(value);
446
450
  if (!ccSame) {
447
- _d[camelCase_1.default(option.name)].push(value);
451
+ _d[(0, camelCase_1.default)(option.name)].push(value);
448
452
  }
449
453
  (_f = option.aliases) === null || _f === void 0 ? void 0 : _f.forEach(function (a) { return _d[a].push(value); });
450
454
  }
@@ -479,10 +483,10 @@ var Massarg = /** @class */ (function () {
479
483
  try {
480
484
  for (var list_2 = __values(list), list_2_1 = list_2.next(); !list_2_1.done; list_2_1 = list_2.next()) {
481
485
  var item = list_2_1.value;
482
- var cmdName = this.color(highlightColors, "" + item.name).padEnd(nameFullSize + this.colorCount(highlightColors) * utils_1.COLOR_CODE_LEN, " ");
483
- var cmdDescr = this.color(normalColors, (_g = item.description) !== null && _g !== void 0 ? _g : "");
486
+ var cmdName = this.color(highlightColors, "".concat(item.name)).padEnd(nameFullSize + this.colorCount(highlightColors) * utils_1.COLOR_CODE_LEN, " ");
487
+ var cmdDesc = this.color(normalColors, (_g = item.description) !== null && _g !== void 0 ? _g : "");
484
488
  try {
485
- for (var _j = (e_9 = void 0, __values(utils_1.wrap(cmdName + cmdDescr, {
489
+ for (var _j = (e_9 = void 0, __values((0, utils_1.wrap)(cmdName + cmdDesc, {
486
490
  indent: nameFullSize + INDENT_LEN,
487
491
  colorCount: this.colorCount(normalColors, highlightColors, item.additionalColorCount ? new Array({ length: item.additionalColorCount }) : []),
488
492
  firstLineIndent: INDENT_LEN,
@@ -526,7 +530,7 @@ var Massarg = /** @class */ (function () {
526
530
  var cmd = _j.value;
527
531
  var opts = this._commandOptions(cmd);
528
532
  if (opts.length) {
529
- commandOpts.push(this.color(subtitleColors, cmd.name + ":"));
533
+ commandOpts.push(this.color(subtitleColors, "".concat(cmd.name, ":")));
530
534
  commandOpts.push("");
531
535
  try {
532
536
  for (var _k = (e_11 = void 0, __values(this._getWrappedLines(opts.map(function (c) { return ({
@@ -596,30 +600,30 @@ var Massarg = /** @class */ (function () {
596
600
  if (c.defaultValue === undefined || !this._help.includeDefaults) {
597
601
  return c.description;
598
602
  }
599
- return [c.description, this.color(this._help.bodyColors, "(default: " + c.defaultValue.toString().trim() + ")")]
603
+ return [c.description, this.color(this._help.bodyColors, "(default: ".concat(c.defaultValue.toString().trim(), ")"))]
600
604
  .filter(Boolean)
601
605
  .join(" ");
602
606
  };
603
607
  Massarg.prototype._fullCmdName = function (cmd) {
604
608
  var _a;
605
- return __spreadArray([cmd.name], __read(((_a = cmd.aliases) !== null && _a !== void 0 ? _a : []))).join(this._help.commandNameSeparator);
609
+ return __spreadArray([cmd.name], __read(((_a = cmd.aliases) !== null && _a !== void 0 ? _a : [])), false).join(this._help.commandNameSeparator);
606
610
  };
607
611
  Massarg.prototype._fullOptName = function (opt) {
608
612
  var _a;
609
- return __spreadArray(["--" + opt.name], __read(((_a = opt.aliases) !== null && _a !== void 0 ? _a : []).map(function (a) { return "-" + a; }))).join(this._help.optionNameSeparator);
613
+ return __spreadArray(["--".concat(opt.name)], __read(((_a = opt.aliases) !== null && _a !== void 0 ? _a : []).map(function (a) { return "-".concat(a); })), false).join(this._help.optionNameSeparator);
610
614
  };
611
615
  Massarg.prototype._commandOptions = function (cmd) {
612
616
  return this._options.filter(function (o) {
613
617
  var _a;
614
- return (utils_1.asArray(o.commands).length && utils_1.asArray(o.commands).includes(cmd.name)) ||
615
- ((_a = cmd.aliases) === null || _a === void 0 ? void 0 : _a.some(function (a) { return utils_1.asArray(o.commands).includes(a); }));
618
+ return ((0, utils_1.asArray)(o.commands).length && (0, utils_1.asArray)(o.commands).includes(cmd.name)) ||
619
+ ((_a = cmd.aliases) === null || _a === void 0 ? void 0 : _a.some(function (a) { return (0, utils_1.asArray)(o.commands).includes(a); }));
616
620
  });
617
621
  };
618
622
  Massarg.prototype._optionCommands = function (opt) {
619
623
  return this._commands.filter(function (c) {
620
- return utils_1.asArray(opt.commands).some(function (_c) {
624
+ return (0, utils_1.asArray)(opt.commands).some(function (_c) {
621
625
  var _a;
622
- return __spreadArray([c.name], __read(((_a = c.aliases) !== null && _a !== void 0 ? _a : []))).includes(_c);
626
+ return __spreadArray([c.name], __read(((_a = c.aliases) !== null && _a !== void 0 ? _a : [])), false).includes(_c);
623
627
  });
624
628
  });
625
629
  };
@@ -637,9 +641,9 @@ var Massarg = /** @class */ (function () {
637
641
  }
638
642
  var output = undefined;
639
643
  try {
640
- for (var _b = __values(utils_1.asArray(color)), _e = _b.next(); !_e.done; _e = _b.next()) {
644
+ for (var _b = __values((0, utils_1.asArray)(color)), _e = _b.next(); !_e.done; _e = _b.next()) {
641
645
  var c = _e.value;
642
- output = chalk_1.default[c].apply(chalk_1.default, __spreadArray([], __read((output ? [output] : text))));
646
+ output = chalk_1.default[c].apply(chalk_1.default, __spreadArray([], __read((output ? [output] : text)), false));
643
647
  }
644
648
  }
645
649
  catch (e_14_1) { e_14 = { error: e_14_1 }; }
@@ -659,7 +663,7 @@ var Massarg = /** @class */ (function () {
659
663
  if (!this._help.useColors) {
660
664
  return 0;
661
665
  }
662
- return utils_1.colorCount.apply(void 0, __spreadArray([], __read(colors)));
666
+ return utils_1.colorCount.apply(void 0, __spreadArray([], __read(colors), false));
663
667
  };
664
668
  return Massarg;
665
669
  }());
package/index.js.map CHANGED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AC9D,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACzB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACtB;QACD,IAAI,MAAM,GAAW,SAAgB,CAAA;;YACrC,KAAgB,IAAA,KAAA,SAAA,IAAA,eAAO,EAAC,KAAK,CAAC,CAAA,gBAAA,4BAAE;gBAA3B,IAAM,CAAC,WAAA;gBACV,MAAM,GAAI,eAAK,CAAC,CAAuB,CAAC,OAA9B,eAAK,2BAAkD,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAC,CAAA;aAC7F;;;;;;;;;QACD,OAAO,eAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC;IAEO,4BAAU,GAAlB;QAAmB,gBAAgB;aAAhB,UAAgB,EAAhB,qBAAgB,EAAhB,IAAgB;YAAhB,2BAAgB;;QACjC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACzB,OAAO,CAAC,CAAA;SACT;QACD,OAAO,kBAAU,wCAAI,MAAM,WAAC;IAC9B,CAAC;IACH,cAAC;AAAD,CAAC,AAxhBD,IAwhBC;AAxhBY,0BAAO;AA0hBpB,SAAgB,OAAO;IACrB,OAAO,IAAI,OAAO,EAAK,CAAA;AACzB,CAAC;AAFD,0BAEC;AAED,kBAAe,OAAO,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "massarg",
3
- "version": "1.0.1",
3
+ "version": "1.0.5",
4
4
  "description": "Flexible, powerful, and simple command/argument parser for CLI applications",
5
5
  "keywords": [
6
6
  "shell",
@@ -16,22 +16,21 @@
16
16
  "license": "Apache",
17
17
  "scripts": {
18
18
  "clean": "rm -rf build",
19
- "build": "echo $(pwd); yarn clean && tsc -p tsconfig.build.json && cp package.json README.md src/*.d.ts build",
19
+ "build": "echo $(pwd); yarn clean && tsc -p tsconfig.build.json && cp package.json README.md build",
20
20
  "develop": "tsc --watch",
21
21
  "test": "jest"
22
22
  },
23
23
  "devDependencies": {
24
- "@types/jest": "^26.0.24",
25
- "@types/lodash": "^4.14.171",
26
- "@types/node": "^16.3.2",
27
- "jest": "^27.0.6",
28
- "jest-coverage-badges": "^1.1.2",
29
- "ts-jest": "^27.0.3",
24
+ "@types/jest": "^27.0.3",
25
+ "@types/lodash": "^4.14.177",
26
+ "@types/node": "^16.11.11",
27
+ "jest": "^27.4.3",
28
+ "ts-jest": "^27.0.7",
30
29
  "ts-node": "^10.1.0",
31
- "typescript": "^4.3.5"
30
+ "typescript": "^4.5.2"
32
31
  },
33
32
  "dependencies": {
34
- "chalk": "^4.1.1",
33
+ "chalk": "^4.1.2",
35
34
  "lodash": "^4.17.21"
36
35
  }
37
36
  }
package/types.d.ts CHANGED
@@ -1,261 +1,224 @@
1
- import { ArrayOr } from "./utils"
2
- import chalk from "chalk"
3
-
4
- export type OptionsBase = {
5
- /** When `true`, will output help text and exit the process without error */
6
- help: boolean
7
-
8
- /** This contains arguments that were not taken by any command or option. */
9
- extras: string[]
10
- }
11
-
12
- export type MainDef<Options> = (options: Options & OptionsBase) => void
13
-
1
+ import { ArrayOr } from "./utils";
2
+ import chalk from "chalk";
3
+ export declare type OptionsBase = {
4
+ /** When `true`, will output help text and exit the process without error */
5
+ help: boolean;
6
+ /** This contains arguments that were not taken by any command or option. */
7
+ extras: string[];
8
+ };
9
+ export declare type MainDef<Options> = (options: Options & OptionsBase) => void;
14
10
  export interface Named {
15
- name: string
16
- aliases?: string[]
11
+ name: string;
12
+ aliases?: string[];
17
13
  }
18
-
19
14
  export interface OptionDef<Options, Value> extends Named {
20
- /** Option name. When using in CLI, you will use `--name`, e.g. `--my-option`. */
21
- name: string
22
-
23
- /**
24
- * When `true`, any args placed without name will be applied to this option. When more than one arg is supplied
25
- * this way, only the last given will be used (unless the option is an array type).
26
- * When more than one option has this turned on, they will all be given these values. Use carefully. */
27
- isDefault?: boolean
28
-
29
- /**
30
- * In addition to primary name, you may also define aliases. Aliases when used in CLI should only be prefixed with
31
- * 1 hypen, as such: `-o`
32
- */
33
- aliases?: string[]
34
-
35
- /** Description of option to display in help text. */
36
- description?: string
37
-
38
- /** Default value to use when none is supplied. */
39
- defaultValue?: Value
40
-
41
- /**
42
- * A boolean field may be supplied without value, which will cause it to parse as `true`.
43
- * Additional parsing may still be done using the `parse` option.
44
- */
45
- boolean?: boolean
46
-
47
- /**
48
- * An array field will collect any inputs to it into a list. Each item in the list will be parsed with `parse` before
49
- * being added.
50
- */
51
- array?: boolean
52
-
53
- /**
54
- * A required option will throw an error if it's not passed as input. If you attach this option to a specific command
55
- * (or multiple commands), it will only be required when using that command. If not, it will be required for any
56
- * command.
57
- */
58
- required?: boolean
59
-
60
- /**
61
- * Commands this option is relevant for. You may use either name or alias of command, but in the help text, only the
62
- * name will be shown as the section title.
63
- *
64
- * If you supply none, this option will be a global option by default.
65
- *
66
- * **Please note** this does not affect parsing: every option will be available when the program is run. This is only
67
- * for organizing it properly in the help text. But as long as you don't use that option in a command that doesn't
68
- * need o use it, nothing should work differently.
69
- */
70
- commands?: ArrayOr<string>
71
-
72
- /**
73
- * Use this function to decide what to do with the arg that was passed. When ommitted, the alue will be returned
74
- * as-is, which is always a string. You may cast or convert your input here so that it will be available already
75
- * parsed when it's needed.
76
- *
77
- * @param value The string arg that was passed
78
- * @param options Any already-parsed options in the current context. The order is not guaranteed, so some args will
79
- * not necessarily be parsed before this one.
80
- */
81
- parse?(value: string, options: Options & OptionsBase): Value
15
+ /** Option name. When using in CLI, you will use `--name`, e.g. `--my-option`. */
16
+ name: string;
17
+ /**
18
+ * When `true`, any args placed without name will be applied to this option. When more than one arg is supplied
19
+ * this way, only the last given will be used (unless the option is an array type).
20
+ * When more than one option has this turned on, they will all be given these values. Use carefully. */
21
+ isDefault?: boolean;
22
+ /**
23
+ * In addition to primary name, you may also define aliases. Aliases when used in CLI should only be prefixed with
24
+ * 1 hypen, as such: `-o`
25
+ */
26
+ aliases?: string[];
27
+ /** Description of option to display in help text. */
28
+ description?: string;
29
+ /** Default value to use when none is supplied. */
30
+ defaultValue?: Value;
31
+ /**
32
+ * A boolean field may be supplied without value, which will cause it to parse as `true`.
33
+ * Additional parsing may still be done using the `parse` option.
34
+ */
35
+ boolean?: boolean;
36
+ /**
37
+ * An array field will collect any inputs to it into a list. Each item in the list will be parsed with `parse` before
38
+ * being added.
39
+ */
40
+ array?: boolean;
41
+ /**
42
+ * A required option will throw an error if it's not passed as input. If you attach this option to a specific command
43
+ * (or multiple commands), it will only be required when using that command. If not, it will be required for any
44
+ * command.
45
+ */
46
+ required?: boolean;
47
+ /**
48
+ * Commands this option is relevant for. You may use either name or alias of command, but in the help text, only the
49
+ * name will be shown as the section title.
50
+ *
51
+ * If you supply none, this option will be a global option by default.
52
+ *
53
+ * **Please note** this does not affect parsing: every option will be available when the program is run. This is only
54
+ * for organizing it properly in the help text. But as long as you don't use that option in a command that doesn't
55
+ * need o use it, nothing should work differently.
56
+ */
57
+ commands?: ArrayOr<string>;
58
+ /**
59
+ * Use this function to decide what to do with the arg that was passed. When ommitted, the alue will be returned
60
+ * as-is, which is always a string. You may cast or convert your input here so that it will be available already
61
+ * parsed when it's needed.
62
+ *
63
+ * @param value The string arg that was passed
64
+ * @param options Any already-parsed options in the current context. The order is not guaranteed, so some args will
65
+ * not necessarily be parsed before this one.
66
+ */
67
+ parse?(value: string, options: Options & OptionsBase): Value;
82
68
  }
83
-
84
69
  export interface CommandDef<T> extends Named {
85
- /**
86
- * Command name. When using in CLI, you will use `name` without any prefixes, unlike options.
87
- * Also, the first command that was parsed will run, and the others will be skipped.
88
- */
89
- name: string
90
-
91
- /** In addition to primary name, you may also define aliases. */
92
- aliases?: string[]
93
-
94
- /** Description of command to display in help text. */
95
- description?: string
96
-
97
- /**
98
- * This is the function that runs this command.
99
- *
100
- * @param options All the parsed options (or defaults) that were passed in the CLI will be available here.
101
- */
102
- run(options: T & OptionsBase): void
70
+ /**
71
+ * Command name. When using in CLI, you will use `name` without any prefixes, unlike options.
72
+ * Also, the first command that was parsed will run, and the others will be skipped.
73
+ */
74
+ name: string;
75
+ /** In addition to primary name, you may also define aliases. */
76
+ aliases?: string[];
77
+ /** Description of command to display in help text. */
78
+ description?: string;
79
+ /**
80
+ * This is the function that runs this command.
81
+ *
82
+ * @param options All the parsed options (or defaults) that were passed in the CLI will be available here.
83
+ */
84
+ run(options: T & OptionsBase): void;
103
85
  }
104
-
105
86
  export interface HelpDef {
106
- /**
107
- * Desired width to accommodate to when outputting help to the shell.
108
- * Descriptions that are longer than this value will be wrapped into the next line.
109
- *
110
- * Default: `80`. Use `0` to disable wrapping. */
111
- printWidth?: number
112
-
113
- /**
114
- * The name of your application binary. Massarg attempts to infer this using the args, but you may override this
115
- * if you don't like the inferred value.
116
- */
117
- binName?: string
118
-
119
- /**
120
- * A single color or array of colors to use on normal text (descriptions, usage example, etc.)
121
- *
122
- * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
123
- * background colors.
124
- *
125
- * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
126
- *
127
- * Defaults to `"dim"`
128
- */
129
- normalColors?: ArrayOr<keyof typeof chalk>
130
-
131
- /**
132
- * A single color or array of colors to use on highlighted text (command names, option names, binary name, etc)
133
- *
134
- * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
135
- * background colors.
136
- *
137
- * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
138
- *
139
- * Defaults to `"yellow"`
140
- */
141
- highlightColors?: ArrayOr<keyof typeof chalk>
142
-
143
- /**
144
- * A single color or array of colors to use on title text ("Options", "Usage", etc)
145
- *
146
- * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
147
- * background colors.
148
- *
149
- * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
150
- *
151
- * Defaults to `"white"`
152
- */
153
- titleColors?: ArrayOr<keyof typeof chalk>
154
-
155
- /**
156
- * A single color or array of colors to use on subtitle text (e.g. command titles for non-gloal options)
157
- *
158
- * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
159
- * background colors.
160
- *
161
- * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
162
- *
163
- * Defaults to `["bold", "dim"]`
164
- */
165
- subtitleColors?: ArrayOr<keyof typeof chalk>
166
-
167
- /**
168
- * A single color or array of colors to use on body text (e.g. header and footer)
169
- *
170
- * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
171
- * background colors.
172
- *
173
- * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
174
- *
175
- * Defaults to `["white"]`
176
- */
177
- bodyColors?: ArrayOr<keyof typeof chalk>
178
-
179
- /**
180
- * Additional content to display below the usage line, and above the rest.
181
- */
182
- header?: string
183
-
184
- /**
185
- * Additional content to display below the commands and options, at the very bottom.
186
- */
187
- footer?: string
188
-
189
- /**
190
- * Separator for command name & its aliases.
191
- *
192
- * Defaults to `" | "`, e.g. for command `"my-cmd"` with aliases `["m", "c"]`, the ourput will be:
193
- *
194
- * ```
195
- * my-cmd | m | c
196
- * ```
197
- */
198
- commandNameSeparator?: string
199
-
200
- /**
201
- * Separator for option name & its aliases.
202
- *
203
- * Defaults to `"|"`, e.g. for option `"my-bool"` with aliases `["m", "b"]`, the ourput will be:
204
- *
205
- * ```
206
- * --my-bool|m|b
207
- * ```
208
- */
209
- optionNameSeparator?: string
210
-
211
- /**
212
- * When `true`, all the command and option names' and descritions' columns will align with each other.
213
- * When `false`, they will all be aligned only within their own category. This can save you white-space when
214
- * you have some long-named options or commands that cause all others to have too much.
215
- *
216
- * Defaults to `false`.
217
- */
218
- useGlobalColumns?: boolean
219
-
220
- /**
221
- * Text to be shown next to the binary name, on the Usage line.
222
- *
223
- * Defaults to `"[command] [options]"`, which outputs:
224
- *
225
- * ```
226
- * my-bin [comman] [options]
227
- * ```
228
- */
229
- usageExample?: string
230
-
231
- /**
232
- * When disabled, all colors in the output will be disabled.
233
- */
234
- useColors?: boolean
235
-
236
- /**
237
- * When disabled, the default values will not be appended to the help text of each option.
238
- */
239
- includeDefaults?: boolean
240
-
241
- /**
242
- * The prefix at the start of the line when presenting examples, at the input (top) line.
243
- */
244
- exampleInputPrefix?: string
245
-
246
- /**
247
- * The prefix at the start of the line when presenting examples, at the output (bottom) line.
248
- */
249
- exampleOutputPrefix?: string
87
+ /**
88
+ * Desired width to accommodate to when outputting help to the shell.
89
+ * Descriptions that are longer than this value will be wrapped into the next line.
90
+ *
91
+ * Default: `80`. Use `0` to disable wrapping. */
92
+ printWidth?: number;
93
+ /**
94
+ * The name of your application binary. Massarg attempts to infer this using the args, but you may override this
95
+ * if you don't like the inferred value.
96
+ */
97
+ binName?: string;
98
+ /**
99
+ * A single color or array of colors to use on normal text (descriptions, usage example, etc.)
100
+ *
101
+ * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
102
+ * background colors.
103
+ *
104
+ * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
105
+ *
106
+ * Defaults to `"dim"`
107
+ */
108
+ normalColors?: ArrayOr<keyof typeof chalk>;
109
+ /**
110
+ * A single color or array of colors to use on highlighted text (command names, option names, binary name, etc)
111
+ *
112
+ * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
113
+ * background colors.
114
+ *
115
+ * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
116
+ *
117
+ * Defaults to `"yellow"`
118
+ */
119
+ highlightColors?: ArrayOr<keyof typeof chalk>;
120
+ /**
121
+ * A single color or array of colors to use on title text ("Options", "Usage", etc)
122
+ *
123
+ * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
124
+ * background colors.
125
+ *
126
+ * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
127
+ *
128
+ * Defaults to `"white"`
129
+ */
130
+ titleColors?: ArrayOr<keyof typeof chalk>;
131
+ /**
132
+ * A single color or array of colors to use on subtitle text (e.g. command titles for non-gloal options)
133
+ *
134
+ * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
135
+ * background colors.
136
+ *
137
+ * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
138
+ *
139
+ * Defaults to `["bold", "dim"]`
140
+ */
141
+ subtitleColors?: ArrayOr<keyof typeof chalk>;
142
+ /**
143
+ * A single color or array of colors to use on body text (e.g. header and footer)
144
+ *
145
+ * The colors are passed to `chalk`, so you can use any color `chalk` supports, including foreground and
146
+ * background colors.
147
+ *
148
+ * **Please note** that combining colors may break wrapping, so please test your help output before releasing.
149
+ *
150
+ * Defaults to `["white"]`
151
+ */
152
+ bodyColors?: ArrayOr<keyof typeof chalk>;
153
+ /**
154
+ * Additional content to display below the usage line, and above the rest.
155
+ */
156
+ header?: string;
157
+ /**
158
+ * Additional content to display below the commands and options, at the very bottom.
159
+ */
160
+ footer?: string;
161
+ /**
162
+ * Separator for command name & its aliases.
163
+ *
164
+ * Defaults to `" | "`, e.g. for command `"my-cmd"` with aliases `["m", "c"]`, the ourput will be:
165
+ *
166
+ * ```
167
+ * my-cmd | m | c
168
+ * ```
169
+ */
170
+ commandNameSeparator?: string;
171
+ /**
172
+ * Separator for option name & its aliases.
173
+ *
174
+ * Defaults to `"|"`, e.g. for option `"my-bool"` with aliases `["m", "b"]`, the ourput will be:
175
+ *
176
+ * ```
177
+ * --my-bool|m|b
178
+ * ```
179
+ */
180
+ optionNameSeparator?: string;
181
+ /**
182
+ * When `true`, all the command and option names' and descritions' columns will align with each other.
183
+ * When `false`, they will all be aligned only within their own category. This can save you white-space when
184
+ * you have some long-named options or commands that cause all others to have too much.
185
+ *
186
+ * Defaults to `false`.
187
+ */
188
+ useGlobalColumns?: boolean;
189
+ /**
190
+ * Text to be shown next to the binary name, on the Usage line.
191
+ *
192
+ * Defaults to `"[command] [options]"`, which outputs:
193
+ *
194
+ * ```
195
+ * my-bin [comman] [options]
196
+ * ```
197
+ */
198
+ usageExample?: string;
199
+ /**
200
+ * When disabled, all colors in the output will be disabled.
201
+ */
202
+ useColors?: boolean;
203
+ /**
204
+ * When disabled, the default values will not be appended to the help text of each option.
205
+ */
206
+ includeDefaults?: boolean;
207
+ /**
208
+ * The prefix at the start of the line when presenting examples, at the input (top) line.
209
+ */
210
+ exampleInputPrefix?: string;
211
+ /**
212
+ * The prefix at the start of the line when presenting examples, at the output (bottom) line.
213
+ */
214
+ exampleOutputPrefix?: string;
250
215
  }
251
-
252
216
  export interface ExampleDef {
253
- /** The input line - to show examples of parameters, commands, etc */
254
- input: string
255
-
256
- /** The output line - to show the output of whatever `input` is regarding. */
257
- output?: string
258
-
259
- /** An optional description which will be used as a title. */
260
- description?: string
217
+ /** The input line - to show examples of parameters, commands, etc */
218
+ input: string;
219
+ /** The output line - to show the output of whatever `input` is regarding. */
220
+ output?: string;
221
+ /** An optional description which will be used as a title. */
222
+ description?: string;
261
223
  }
224
+ //# sourceMappingURL=types.d.ts.map
package/types.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,oBAAY,WAAW,GAAG;IACxB,4EAA4E;IAC5E,IAAI,EAAE,OAAO,CAAA;IAEb,4EAA4E;IAC5E,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB,CAAA;AAED,oBAAY,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,KAAK,IAAI,CAAA;AAEvE,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,SAAS,CAAC,OAAO,EAAE,KAAK,CAAE,SAAQ,KAAK;IACtD,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAA;IAEZ;;;2GAGuG;IACvG,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,OAAO,CAAC,E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,CAAC,CAAA;IAE5C;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,OAAO,KAAK,CAAC,CAAA;IAExC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAE1B;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,UAAU;IACzB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAA;IAEb,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB"}
package/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/utils.js CHANGED
@@ -26,10 +26,14 @@ var __read = (this && this.__read) || function (o, n) {
26
26
  }
27
27
  return ar;
28
28
  };
29
- var __spreadArray = (this && this.__spreadArray) || function (to, from) {
30
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
31
- to[j] = from[i];
32
- return to;
29
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
30
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
31
+ if (ar || !(i in from)) {
32
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
33
+ ar[i] = from[i];
34
+ }
35
+ }
36
+ return to.concat(ar || Array.prototype.slice.call(from));
33
37
  };
34
38
  var __importDefault = (this && this.__importDefault) || function (mod) {
35
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -50,7 +54,7 @@ function color(color) {
50
54
  try {
51
55
  for (var _b = __values(asArray(color)), _c = _b.next(); !_c.done; _c = _b.next()) {
52
56
  var c = _c.value;
53
- output = chalk_1.default[c].apply(chalk_1.default, __spreadArray([], __read((output ? [output] : text))));
57
+ output = chalk_1.default[c].apply(chalk_1.default, __spreadArray([], __read((output ? [output] : text)), false));
54
58
  }
55
59
  }
56
60
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -73,7 +77,7 @@ function colorCount() {
73
77
  exports.colorCount = colorCount;
74
78
  function wrap(text, options) {
75
79
  var _a, _b;
76
- var _opts = merge_1.default({
80
+ var _opts = (0, merge_1.default)({
77
81
  printWidth: 100,
78
82
  indent: 0,
79
83
  colorCount: 0,
@@ -82,7 +86,7 @@ function wrap(text, options) {
82
86
  var firstIndentSize = (_b = _opts.firstLineIndent) !== null && _b !== void 0 ? _b : indentSize;
83
87
  var maxLineLength = _opts.printWidth - firstIndentSize + exports.COLOR_CODE_LEN * _opts.colorCount;
84
88
  function indent(i, l) {
85
- return repeat_1.default(" ", i === 0 ? firstIndentSize : indentSize) + l;
89
+ return (0, repeat_1.default)(" ", i === 0 ? firstIndentSize : indentSize) + l;
86
90
  }
87
91
  if (!_opts.printWidth || maxLineLength <= 0) {
88
92
  return text.split("\n").map(function (l, i) { return indent(i, l); });
@@ -94,7 +98,7 @@ function wrap(text, options) {
94
98
  .slice(1)
95
99
  .map(function (l) { return l.trim(); })
96
100
  .join(" ")
97
- .trim(), maxLineLength - indentSize - exports.COLOR_CODE_LEN).map(function (l, i) { return indent(i + 1, l); }))).filter(function (l) { return l.trim().length; });
101
+ .trim(), maxLineLength - indentSize - exports.COLOR_CODE_LEN).map(function (l, i) { return indent(i + 1, l); })), false).filter(function (l) { return l.trim().length; });
98
102
  return lines;
99
103
  }
100
104
  exports.wrap = wrap;
package/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,mCAAmC;AACnC,yDAAkC;AAClC,uDAAgC;AAEhC,SAAgB,KAAK,CAAC,KAAkC;;IAAE,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IACtE,IAAI,MAAM,GAAW,SAAgB,CAAA;;QACrC,KAAgB,IAAA,KAAA,SAAA,OAAO,CAAC,KAAK,CAAC,CAAA,gBAAA,4BAAE;YAA3B,IAAM,CAAC,WAAA;YACV,MAAM,GAAI,eAAK,CAAC,CAAuB,CAAC,OAA9B,eAAK,2BAAkD,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAC,CAAA;SAC7F;;;;;;;;;IACD,OAAO,eAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;AAC5B,CAAC;AAND,sBAMC;AAED,SAAgB,UAAU;IAAC,gBAAgB;SAAhB,UAAgB,EAAhB,qBAAgB,EAAhB,IAAgB;QAAhB,2BAAgB;;IACzC,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,QAAQ,IAAK,OAAA,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAA9B,CAA8B,EAAE,CAAC,CAAC,CAAA;AACrF,CAAC;AAFD,gCAEC;AASD,SAAgB,IAAI,CAAC,IAAY,EAAE,OAAqB;;IACtD,IAAM,KA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