massarg 1.0.3 → 1.0.4

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/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
@@ -24,6 +24,9 @@ var RequiredError = /** @class */ (function (_super) {
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,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;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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AAO,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
@@ -56,7 +56,7 @@ var Massarg = /** @class */ (function () {
56
56
  this._maxNameLen = 0;
57
57
  /**
58
58
  * These are the parsed options passed via args. They will only be available after using `parse()` or `printHelp()`,
59
- * or when retured by `parseArgs()`. */
59
+ * or when returned by `parseArgs()`. */
60
60
  this.data = { help: false, extras: [] };
61
61
  this._help = {
62
62
  binName: undefined,
@@ -299,10 +299,9 @@ var Massarg = /** @class */ (function () {
299
299
  }
300
300
  }
301
301
  catch (e) {
302
- if (e.cmdName && e.fieldName) {
303
- console.log();
304
- console.error("Error");
302
+ if (errors_1.RequiredError.isRequiredError(e)) {
305
303
  console.error(chalk_1.default.red(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", ""], ["", ""])), e.message));
304
+ process.exit(1);
306
305
  }
307
306
  throw e;
308
307
  }
@@ -481,9 +480,9 @@ var Massarg = /** @class */ (function () {
481
480
  for (var list_2 = __values(list), list_2_1 = list_2.next(); !list_2_1.done; list_2_1 = list_2.next()) {
482
481
  var item = list_2_1.value;
483
482
  var cmdName = this.color(highlightColors, "" + item.name).padEnd(nameFullSize + this.colorCount(highlightColors) * utils_1.COLOR_CODE_LEN, " ");
484
- var cmdDescr = this.color(normalColors, (_g = item.description) !== null && _g !== void 0 ? _g : "");
483
+ var cmdDesc = this.color(normalColors, (_g = item.description) !== null && _g !== void 0 ? _g : "");
485
484
  try {
486
- for (var _j = (e_9 = void 0, __values(utils_1.wrap(cmdName + cmdDescr, {
485
+ for (var _j = (e_9 = void 0, __values(utils_1.wrap(cmdName + cmdDesc, {
487
486
  indent: nameFullSize + INDENT_LEN,
488
487
  colorCount: this.colorCount(normalColors, highlightColors, item.additionalColorCount ? new Array({ length: item.additionalColorCount }) : []),
489
488
  firstLineIndent: INDENT_LEN,
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,gDAAyB;AACzB,uDAAgC;AAChC,+DAAwC;AACxC,8CAAuB;AAEvB,iCAA4E;AAC5E,mCAAwC;AACxC,2CAAiG;AAEjG;IAiC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AA;gBACV,MAAM,GAAI,eAAK,CAAC,CAAuB,CAAC,OAA9B,eAAK,2BAAkD,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAC,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,IAAC;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.3",
3
+ "version": "1.0.4",
4
4
  "description": "Flexible, powerful, and simple command/argument parser for CLI applications",
5
5
  "keywords": [
6
6
  "shell",
@@ -16,7 +16,7 @@
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
  },
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,CA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;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":""}