massarg 2.0.0-pre.1 → 2.0.0-pre.11

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/help.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,YAAY,EAAqB,MAAM,SAAS,CAAA;AAEzD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOrC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA6B,CAAA;AACnE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAEjF,eAAO,MAAM,UAAU;IACrB;;;;OAIG;;IAEH;;;;OAIG;;IAGH,mDAAmD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEnD,kDAAkD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAElD,8BAA8B;;;;;;;;;;;;;;;;;IAE9B,oCAAoC;;;;;;;;;;;;;;;;;IAEpC,qEAAqE;;;;;;;;;;;;;;;;;IAErE,8BAA8B;;;;;;;;;;;;;;;;;IAE9B,+BAA+B;;;;;;;;;;;;;;;;;IAE/B,+BAA+B;;;;;;;;;;;;;;;;;IA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,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,CAAC,EAAE,GAAG,CAAA;CACnB,CAAA;AAED,qBAAa,aAAa;IACxB,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;IAC1B,MAAM,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;gBAEpB,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,EAAE,UAAU;IAK3D,QAAQ,IAAI,MAAM;IAuHlB,SAAS,IAAI,IAAI;CAGlB"}
package/help.js CHANGED
@@ -7,15 +7,29 @@ exports.HelpGenerator = exports.defaultHelpConfig = exports.HelpConfig = exports
7
7
  const zod_1 = __importDefault(require("zod"));
8
8
  const style_1 = require("./style");
9
9
  const utils_1 = require("./utils");
10
+ const option_1 = require("./option");
10
11
  exports.GenerateTableCommandConfig = zod_1.default.object({
11
- maxRowLength: zod_1.default.number().optional(),
12
- namePrefix: zod_1.default.string().optional(),
13
- aliasPrefix: zod_1.default.string().optional(),
12
+ /** Length of each row in the table */
13
+ lineLength: zod_1.default.number().optional(),
14
+ /** When `false`, each row is separated by a blank line */
14
15
  compact: zod_1.default.boolean().optional(),
16
+ /** Style of the command/option name */
15
17
  nameStyle: style_1.StringStyle.optional(),
18
+ /** Style of the command/option description */
16
19
  descriptionStyle: style_1.StringStyle.optional(),
20
+ /** Prefix for the command/option name (default is the command's prefix) */
21
+ namePrefix: zod_1.default.string().optional(),
22
+ /** Prefix for the command/option aliases (default is the command's prefix) */
23
+ aliasPrefix: zod_1.default.string().optional(),
17
24
  });
18
- exports.GenerateTableOptionConfig = exports.GenerateTableCommandConfig;
25
+ exports.GenerateTableOptionConfig = exports.GenerateTableCommandConfig.merge(zod_1.default.object({
26
+ /** Whether to display negations with each option name */
27
+ displayNegations: zod_1.default.boolean().optional(),
28
+ /** Whether to display the default value with each option (if it has one) */
29
+ displayDefaultValue: zod_1.default.boolean().optional(),
30
+ /** Style of the default value */
31
+ defaultValueStyle: style_1.StringStyle.optional(),
32
+ }));
19
33
  exports.HelpConfig = zod_1.default.object({
20
34
  /**
21
35
  * Whether to bind the help command to this command
@@ -29,10 +43,16 @@ exports.HelpConfig = zod_1.default.object({
29
43
  * Set this to `true` to automatically add a `--help` option to this command's options.
30
44
  */
31
45
  bindOption: zod_1.default.boolean().optional(),
46
+ /** Whether to align all tables to the column widths, or have each table be independent. Default is `true` */
47
+ useGlobalTableColumns: zod_1.default.boolean().default(true).optional(),
32
48
  /** Options for generating the table of commands */
33
- commandOptions: exports.GenerateTableCommandConfig.omit({ maxRowLength: true }).optional(),
49
+ commandOptions: exports.GenerateTableCommandConfig.omit({
50
+ lineLength: true,
51
+ dislayDefaultValue: true,
52
+ defaultValueStyle: true,
53
+ }).optional(),
34
54
  /** Options for generating the table of options */
35
- optionOptions: exports.GenerateTableOptionConfig.omit({ maxRowLength: true }).optional(),
55
+ optionOptions: exports.GenerateTableOptionConfig.omit({ lineLength: true }).optional(),
36
56
  /** Style of the help title */
37
57
  titleStyle: style_1.StringStyle.optional(),
38
58
  /** Style of the help description */
@@ -40,13 +60,27 @@ exports.HelpConfig = zod_1.default.object({
40
60
  /** Style of the help subtitles for commands, options and examples */
41
61
  subtitleStyle: style_1.StringStyle.optional(),
42
62
  /** Style of the help usage */
43
- usageStyle: style_1.StringStyle.optional(),
63
+ usageStyle: zod_1.default
64
+ .object({
65
+ /** Style of the help usage title - appears before the usage text (custom or auto) */
66
+ prefix: style_1.StringStyle.optional(),
67
+ /**
68
+ * For custom usage text, this is the primary style used (right after the `prefix` style).
69
+ * For automated usage text, this style is used for the command/binary name
70
+ */
71
+ main: style_1.StringStyle.optional(),
72
+ /** Style of the help usage commands (if any) */
73
+ command: style_1.StringStyle.optional(),
74
+ /** Style of the help usage options (if any) */
75
+ options: style_1.StringStyle.optional(),
76
+ })
77
+ .optional(),
44
78
  /** Style of the help header */
45
79
  headerStyle: style_1.StringStyle.optional(),
46
80
  /** Style of the help footer */
47
81
  footerStyle: style_1.StringStyle.optional(),
48
82
  /** Maximum length of a row in the help output */
49
- maxRowLength: zod_1.default.number().optional(),
83
+ lineLength: zod_1.default.number().optional(),
50
84
  /** Options for examples section */
51
85
  exampleOptions: zod_1.default
52
86
  .object({
@@ -56,10 +90,14 @@ exports.HelpConfig = zod_1.default.object({
56
90
  inputStyle: style_1.StringStyle.optional(),
57
91
  /** Style of the example output */
58
92
  outputStyle: style_1.StringStyle.optional(),
59
- /** Prefix for the example input */
93
+ /** Prefix for the example input (default: `$`) */
60
94
  inputPrefix: zod_1.default.string().default('$').optional(),
61
- /** Prefix for the example output */
62
- outputPrefix: zod_1.default.string().default('>').optional(),
95
+ /** Prefix for the example output (default: `>`) */
96
+ outputPrefix: zod_1.default.string().default('').optional(),
97
+ /** Style of the example input/output prefixes */
98
+ prefixStyle: style_1.StringStyle.optional(),
99
+ /** Whether to compact the examples section */
100
+ compact: zod_1.default.boolean().default(true).optional(),
63
101
  })
64
102
  .optional(),
65
103
  /** Text to display at the very top, describing CLI usage */
@@ -70,10 +108,9 @@ exports.HelpConfig = zod_1.default.object({
70
108
  footerText: zod_1.default.string().optional(),
71
109
  });
72
110
  exports.defaultHelpConfig = {
73
- maxRowLength: 80,
111
+ lineLength: 80,
112
+ useGlobalTableColumns: true,
74
113
  commandOptions: {
75
- namePrefix: '',
76
- aliasPrefix: '',
77
114
  nameStyle: {
78
115
  color: 'yellow',
79
116
  },
@@ -82,14 +119,19 @@ exports.defaultHelpConfig = {
82
119
  },
83
120
  },
84
121
  optionOptions: {
85
- namePrefix: '--',
86
- aliasPrefix: '-',
122
+ namePrefix: option_1.DEFAULT_OPT_FULL_PREFIX,
123
+ aliasPrefix: option_1.DEFAULT_OPT_SHORT_PREFIX,
124
+ displayNegations: false,
125
+ displayDefaultValue: true,
87
126
  nameStyle: {
88
127
  color: 'yellow',
89
128
  },
90
129
  descriptionStyle: {
91
130
  color: 'gray',
92
131
  },
132
+ defaultValueStyle: {
133
+ color: 'brightWhite',
134
+ },
93
135
  },
94
136
  descriptionStyle: {},
95
137
  exampleOptions: {
@@ -104,7 +146,11 @@ exports.defaultHelpConfig = {
104
146
  color: 'brightWhite',
105
147
  },
106
148
  inputPrefix: '$',
107
- outputPrefix: '>',
149
+ outputPrefix: '',
150
+ prefixStyle: {
151
+ color: 'gray',
152
+ },
153
+ compact: true,
108
154
  },
109
155
  bindCommand: false,
110
156
  bindOption: false,
@@ -113,8 +159,19 @@ exports.defaultHelpConfig = {
113
159
  color: 'yellow',
114
160
  },
115
161
  usageStyle: {
116
- bold: true,
117
- color: 'yellow',
162
+ prefix: {
163
+ bold: true,
164
+ color: 'brightWhite',
165
+ },
166
+ main: {
167
+ color: 'yellow',
168
+ },
169
+ command: {
170
+ color: 'gray',
171
+ },
172
+ options: {
173
+ color: 'gray',
174
+ },
118
175
  },
119
176
  subtitleStyle: {
120
177
  bold: true,
@@ -130,78 +187,92 @@ exports.defaultHelpConfig = {
130
187
  class HelpGenerator {
131
188
  constructor(entry, config) {
132
189
  this.entry = entry;
133
- this.config = exports.HelpConfig.required().parse({
134
- ...entry.helpConfig,
135
- commandOptions: {
136
- ...entry.helpConfig?.commandOptions,
137
- ...config?.commandOptions,
138
- },
139
- optionOptions: {
140
- ...entry.helpConfig?.optionOptions,
141
- ...config?.optionOptions,
142
- },
143
- });
190
+ this.config = exports.HelpConfig.required().parse((0, utils_1._deepMerge)(entry.helpConfig, config));
144
191
  }
145
192
  generate() {
146
193
  const entry = this.entry;
147
194
  const CMD_OPT_INDENT = 4;
148
- const _wrap = (text, indent = 0) => wrap(text, this.config.maxRowLength - indent);
149
- const options = generateHelpTable(entry.options, {
195
+ const _wrap = (text, indent = 0) => wrap(text, this.config.lineLength - indent);
196
+ const _subindent = (text, amt) => text.replace(/\n/g, '\n' + ' '.repeat(amt));
197
+ const optionOptions = {
150
198
  ...this.config.optionOptions,
151
- maxRowLength: this.config.maxRowLength - CMD_OPT_INDENT,
152
- }).trimEnd();
153
- const commands = generateHelpTable(entry.commands, {
199
+ lineLength: this.config.lineLength - CMD_OPT_INDENT,
200
+ };
201
+ const commandOptions = {
154
202
  ...this.config.commandOptions,
155
- maxRowLength: this.config.maxRowLength - CMD_OPT_INDENT,
156
- }).trimEnd();
203
+ displayNegations: false,
204
+ lineLength: this.config.lineLength - CMD_OPT_INDENT,
205
+ };
206
+ const maxNameLength = this.config.useGlobalTableColumns
207
+ ? Math.max(getMaxNameLength(entry.options.map((e) => getItemDetails(e, optionOptions))), getMaxNameLength(entry.commands.map((e) => getItemDetails(e, commandOptions))))
208
+ : undefined;
209
+ const options = generateHelpTable(entry.options, optionOptions, maxNameLength).trimEnd();
210
+ const commands = generateHelpTable(entry.commands, commandOptions, maxNameLength).trimEnd();
157
211
  const examples = entry.examples
158
212
  .map((example) => {
159
213
  const { description, input, output } = example;
160
214
  return (0, utils_1.strConcat)(description && [
161
215
  _wrap((0, style_1.format)(description, this.config.exampleOptions.descriptionStyle), 4),
162
- '',
163
- ], input &&
164
- _wrap((0, style_1.format)([this.config.exampleOptions.inputPrefix, input].filter(Boolean).join(' '), this.config.exampleOptions.inputStyle), 4), output &&
165
- _wrap((0, style_1.format)([this.config.exampleOptions.outputPrefix, output].filter(Boolean).join(' '), this.config.exampleOptions.outputStyle), 4));
216
+ ], ...(description && input && this.config.exampleOptions.compact ? [] : ['']), input &&
217
+ _subindent(_wrap([
218
+ this.config.exampleOptions.inputPrefix &&
219
+ (0, style_1.format)(this.config.exampleOptions.inputPrefix, this.config.exampleOptions.prefixStyle),
220
+ (0, style_1.format)(input, this.config.exampleOptions.inputStyle),
221
+ ]
222
+ .filter(Boolean)
223
+ .join(' '), 4), (this.config.exampleOptions.inputPrefix ?? '').length + 1), output &&
224
+ _subindent(_wrap([
225
+ this.config.exampleOptions.outputPrefix &&
226
+ (0, style_1.format)(this.config.exampleOptions.outputPrefix, this.config.exampleOptions.prefixStyle),
227
+ (0, style_1.format)(output, this.config.exampleOptions.outputStyle),
228
+ ]
229
+ .filter(Boolean)
230
+ .join(' '), 4), (this.config.exampleOptions.outputPrefix ?? '').length + 1), '');
166
231
  })
167
232
  .join('\n');
168
233
  const { headerText, footerText, usageText } = this.config;
169
- return ((0, utils_1.strConcat)(_wrap((0, style_1.format)(usageText ||
170
- [`Usage:`, entry.name, commands.length && '[command]', options.length && '[options]']
234
+ return ((0, utils_1.strConcat)(_wrap(usageText
235
+ ? (0, utils_1.strConcat)((0, style_1.format)('Usage:', this.config.usageStyle.prefix), (0, style_1.format)(usageText, this.config.usageStyle.main))
236
+ : [
237
+ (0, style_1.format)(`Usage:`, this.config.usageStyle.prefix),
238
+ (0, style_1.format)(entry.name, this.config.usageStyle.main),
239
+ commands.length && (0, style_1.format)('[command]', this.config.usageStyle.command),
240
+ options.length && (0, style_1.format)('[options]', this.config.usageStyle.options),
241
+ ]
171
242
  .filter(Boolean)
172
- .join(' '), this.config.usageStyle)), headerText.length && ['', (0, style_1.format)(headerText, this.config.descriptionStyle)], entry.description.length && [
243
+ .join(' ')), headerText.length && ['', (0, style_1.format)(headerText, this.config.descriptionStyle)], entry.description.length && [
173
244
  '',
174
245
  _wrap((0, style_1.format)(entry.description, this.config.descriptionStyle)),
175
246
  ], commands.length &&
176
247
  (0, utils_1.indent)([
177
248
  '',
178
- (0, style_1.format)(`Commands for ${entry.name}:`, this.config.subtitleStyle),
249
+ (0, style_1.format)(entry.parent ? `Commands for ${entry.name}:` : 'Commands:', this.config.subtitleStyle),
179
250
  '',
180
251
  (0, utils_1.indent)(commands),
181
252
  ]), options.length &&
182
253
  (0, utils_1.indent)([
183
254
  '',
184
- (0, style_1.format)(`Options for ${entry.name}:`, this.config.subtitleStyle),
255
+ (0, style_1.format)(entry.parent ? `Options for ${entry.name}:` : 'Options:', this.config.subtitleStyle),
185
256
  '',
186
257
  (0, utils_1.indent)(options),
187
258
  ]), examples.length &&
188
- (0, utils_1.indent)(['', (0, style_1.format)('Examples:', this.config.subtitleStyle), '', (0, utils_1.indent)(examples)]), footerText.length && ['', _wrap((0, style_1.format)(footerText, this.config.descriptionStyle))]) + '\n');
259
+ (0, utils_1.indent)(['', (0, style_1.format)('Examples:', this.config.subtitleStyle), '', (0, utils_1.indent)(examples)]), footerText.length && ['', (0, style_1.format)(footerText, this.config.descriptionStyle)]) + '\n');
189
260
  }
190
261
  printHelp() {
191
262
  console.log(this.generate());
192
263
  }
193
264
  }
194
265
  exports.HelpGenerator = HelpGenerator;
195
- function wrap(text, maxRowLength) {
266
+ function wrap(text, lineLength) {
196
267
  const length = (0, style_1.stripStyle)(text).length;
197
- if (length <= maxRowLength) {
268
+ if (length <= lineLength) {
198
269
  return text;
199
270
  }
200
271
  const subRows = [];
201
272
  const words = text.split(' ');
202
273
  let currentRow = '';
203
274
  for (const word of words) {
204
- if ((0, style_1.stripStyle)(currentRow).length + (0, style_1.stripStyle)(word).length + 1 > maxRowLength) {
275
+ if ((0, style_1.stripStyle)(currentRow).length + (0, style_1.stripStyle)(word).length + 1 > lineLength) {
205
276
  subRows.push(currentRow);
206
277
  currentRow = '';
207
278
  }
@@ -210,23 +281,49 @@ function wrap(text, maxRowLength) {
210
281
  subRows.push(currentRow);
211
282
  return subRows.join('\n');
212
283
  }
213
- function generateHelpTable(items, { maxRowLength = 80, namePrefix = '', aliasPrefix = '', compact = false, ...config } = {}) {
284
+ const getMaxNameLength = (items) => Math.max(...items.map((o) => o.name.length));
285
+ function getItemDetails(o, options) {
286
+ const { displayNegations = false, namePrefix = '', aliasPrefix = '' } = options ?? {};
287
+ const description = o.description;
288
+ const hidden = o.hidden || false;
289
+ const negatable = (displayNegations && o.negatable) || false;
290
+ const defaultValue = o.defaultValue ?? null;
291
+ const cmdNames = {
292
+ full: `${namePrefix}${o.name}`,
293
+ fullNegated: `${namePrefix}no-${o.name}`,
294
+ aliases: o.aliases.map((a) => `${aliasPrefix}${a}`).join(' | '),
295
+ aliasesNegated: o.aliases.map((a) => `${aliasPrefix}${a}`).join(' | '),
296
+ };
297
+ const name = [
298
+ cmdNames.full,
299
+ cmdNames.aliases,
300
+ negatable && cmdNames.fullNegated,
301
+ negatable && cmdNames.aliasesNegated,
302
+ ]
303
+ .filter(Boolean)
304
+ .join(' | ');
305
+ return { name, description, hidden, negatable, displayNegations, defaultValue };
306
+ }
307
+ function generateHelpTable(items, fullConfig = {}, maxNameLength) {
308
+ const { lineLength = 80, namePrefix = '', aliasPrefix = '', displayNegations = false, displayDefaultValue = false, compact = false, ...config } = fullConfig;
214
309
  const rows = items
215
- .map((o) => {
216
- const name = `${namePrefix}${o.name}${o.aliases.length ? ` | ${aliasPrefix}${o.aliases.join(`|${aliasPrefix}`)}` : ''}`;
217
- const description = o.description;
218
- const hidden = o.hidden || false;
219
- return { name, description, hidden };
220
- })
310
+ .map((o) => getItemDetails(o, {
311
+ namePrefix,
312
+ aliasPrefix,
313
+ displayNegations,
314
+ }))
221
315
  .filter((r) => !r.hidden);
222
- const maxNameLength = Math.max(...rows.map((o) => o.name.length));
316
+ maxNameLength ??= getMaxNameLength(rows);
223
317
  const nameStyle = (name) => (0, style_1.format)(name, config.nameStyle);
224
318
  const descStyle = (desc) => (0, style_1.format)(desc, config.descriptionStyle);
225
319
  const table = rows.map((row) => {
226
320
  const name = nameStyle(row.name.padEnd(maxNameLength + 2));
227
- const description = descStyle(row.description);
321
+ let description = descStyle(row.description);
322
+ if (displayDefaultValue && row.defaultValue != null) {
323
+ description += ` ${(0, style_1.format)(`(default: ${row.defaultValue})`, config.defaultValueStyle)}`;
324
+ }
228
325
  const length = (0, style_1.stripStyle)(name).length + (0, style_1.stripStyle)(description).length;
229
- if (length <= maxRowLength) {
326
+ if (length <= lineLength) {
230
327
  const line = `${name}${description}`;
231
328
  if (!compact) {
232
329
  return `${line}\n`;
@@ -237,12 +334,13 @@ function generateHelpTable(items, { maxRowLength = 80, namePrefix = '', aliasPre
237
334
  const words = description.split(' ');
238
335
  let currentRow = name;
239
336
  for (const word of words) {
240
- if ((0, style_1.stripStyle)(currentRow).length + (0, style_1.stripStyle)(word).length + 1 > maxRowLength) {
337
+ if ((0, style_1.stripStyle)(currentRow).length + (0, style_1.stripStyle)(word).length + 1 > lineLength) {
241
338
  subRows.push(currentRow);
242
339
  currentRow = ' '.repeat(maxNameLength + 2);
243
340
  }
244
341
  currentRow += `${word} `;
245
342
  }
343
+ subRows.push(currentRow);
246
344
  if (!compact) {
247
345
  subRows.push('');
248
346
  }
package/help.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmB;AACnB,mCAAyD;AAEzD,mCAAyD;AAE5C,QAAA,0BAA0B,GAAG,aAAC,CAAC,MAAM,CAAC;IACjD,YAAY,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,aAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC/B,SAAS,EAAE,mBAAW,CAAC,QAAQ,EAAE;IACjC,gBAAgB,EAAE,mBAAW,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAA;AAGW,QAAA,yBAAyB,GAAG,kCAA0B,CAAA;AAGtD,QAAA,UAAU,GAAG,aAAC,CAAC,MAAM,CAAC;IACjC;;;;OAIG;IACH,WAAW,EAAE,aAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnC;;;;OAIG;IACH,UAAU,EAAE,aAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAElC,mDAAmD;IACnD,cAAc,EAAE,kCAA0B,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;IAClF,kDAAkD;IAClD,aAAa,EAAE,iCAAyB,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE;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EAAC,WAAW,CAAC,CAAC,MAAM,CAAA;QACvE,IAAI,MAAM,IAAI,UAAU,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,GAAG,IAAI,GAAG,WAAW,EAAE,CAAA;YACpC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,OAAO,GAAG,IAAI,IAAI,CAAA;YACpB,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,OAAO,GAAa,EAAE,CAAA;QAC5B,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACpC,IAAI,UAAU,GAAG,IAAI,CAAA;QAErB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAC,MAAM,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,EAAE,CAAC;gBAC7E,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;gBACxB,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,aAAc,GAAG,CAAC,CAAC,CAAA;YAC7C,CAAC;YACD,UAAU,IAAI,GAAG,IAAI,GAAG,CAAA;QAC1B,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAExB,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAClB,CAAC;QAED,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC,CAAC,CAAA;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
package/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
+ import { massarg } from './massarg';
1
2
  export * from './massarg';
3
+ export default massarg;
2
4
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,cAAc,WAAW,CAAA;AAEzB,eAAe,OAAO,CAAA"}
package/index.js CHANGED
@@ -14,5 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ const massarg_1 = require("./massarg");
17
18
  __exportStar(require("./massarg"), exports);
19
+ exports.default = massarg_1.massarg;
18
20
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAmC;AAEnC,4CAAyB;AAEzB,kBAAe,iBAAO,CAAA"}
package/massarg.d.ts CHANGED
@@ -1,8 +1,20 @@
1
1
  import { ArgsObject, CommandConfig, MassargCommand } from './command';
2
- type MinimalCommandConfig<Args extends ArgsObject> = Omit<CommandConfig<Args>, 'aliases' | 'run'> & Partial<Pick<CommandConfig<Args>, 'aliases' | 'run'>>;
2
+ /** A minimal command config that can be used to create a top-level command. */
3
+ export type MinimalCommandConfig<Args extends ArgsObject = ArgsObject> = Omit<CommandConfig<Args>, 'aliases' | 'run'> & Partial<Pick<CommandConfig<Args>, 'aliases' | 'run'>>;
4
+ /**
5
+ * This class behaves similarly to {@link MassargCommand}, but it accepts only params that are relevant
6
+ * to the top-level command.
7
+ *
8
+ * @see {@link massarg}
9
+ * @see {@link MassargCommand}
10
+ */
3
11
  export declare class Massarg<Args extends ArgsObject = ArgsObject> extends MassargCommand<Args> {
4
12
  constructor(options: MinimalCommandConfig<Args>);
5
13
  }
14
+ /**
15
+ * Creates a new top-level command.
16
+ * @see {@link MassargCommand}
17
+ * @see {@link Massarg}
18
+ */
6
19
  export declare function massarg<Args extends ArgsObject = ArgsObject>(options: MinimalCommandConfig<Args>): MassargCommand<Args>;
7
- export {};
8
20
  //# sourceMappingURL=massarg.d.ts.map
package/massarg.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"massarg.d.ts","sourceRoot":"","sources":["../src/massarg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAErE,KAAK,oBAAoB,CAAC,IAAI,SAAS,UAAU,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,GAC/F,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAA;AAEvD,qBAAa,OAAO,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,CAAE,SAAQ,cAAc,CAAC,IAAI,CAAC;gBACzE,OAAO,EAAE,oBAAoB,CAAC,IAAI,CAAC;CAWhD;AAED,wBAAgB,OAAO,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,EAC1D,OAAO,EAAE,oBAAoB,CAAC,IAAI,CAAC,GAClC,cAAc,CAAC,IAAI,CAAC,CAEtB"}
1
+ {"version":3,"file":"massarg.d.ts","sourceRoot":"","sources":["../src/massarg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAErE,+EAA+E;AAC/E,MAAM,MAAM,oBAAoB,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,IAAI,IAAI,CAC3E,aAAa,CAAC,IAAI,CAAC,EACnB,SAAS,GAAG,KAAK,CAClB,GACC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC,CAAA;AAEvD;;;;;;GAMG;AACH,qBAAa,OAAO,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,CAAE,SAAQ,cAAc,CAAC,IAAI,CAAC;gBACzE,OAAO,EAAE,oBAAoB,CAAC,IAAI,CAAC;CAWhD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,EAC1D,OAAO,EAAE,oBAAoB,CAAC,IAAI,CAAC,GAClC,cAAc,CAAC,IAAI,CAAC,CAEtB"}
package/massarg.js CHANGED
@@ -2,6 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.massarg = exports.Massarg = void 0;
4
4
  const command_1 = require("./command");
5
+ /**
6
+ * This class behaves similarly to {@link MassargCommand}, but it accepts only params that are relevant
7
+ * to the top-level command.
8
+ *
9
+ * @see {@link massarg}
10
+ * @see {@link MassargCommand}
11
+ */
5
12
  class Massarg extends command_1.MassargCommand {
6
13
  constructor(options) {
7
14
  // TODO consider re-using name and description for general help, and pass them to super
@@ -16,6 +23,11 @@ class Massarg extends command_1.MassargCommand {
16
23
  }
17
24
  }
18
25
  exports.Massarg = Massarg;
26
+ /**
27
+ * Creates a new top-level command.
28
+ * @see {@link MassargCommand}
29
+ * @see {@link Massarg}
30
+ */
19
31
  function massarg(options) {
20
32
  return new Massarg(options);
21
33
  }
package/massarg.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"massarg.js","sourceRoot":"","sources":["../src/massarg.ts"],"names":[],"mappings":";;;AAAA,uCAAqE;AAKrE,MAAa,OAA8C,SAAQ,wBAAoB;IACrF,YAAY,OAAmC;QAC7C,uFAAuF;QACvF,KAAK,CAAC;YACJ,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,GAAG,EAAE;gBACR,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;gBAC9B,8CAA8C;YAChD,CAAC;YACD,GAAG,OAAO;SACX,CAAC,CAAA;IACJ,CAAC;CACF;AAZD,0BAYC;AAED,SAAgB,OAAO,CACrB,OAAmC;IAEnC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;AAC7B,CAAC;AAJD,0BAIC"}
1
+ {"version":3,"file":"massarg.js","sourceRoot":"","sources":["../src/massarg.ts"],"names":[],"mappings":";;;AAAA,uCAAqE;AASrE;;;;;;GAMG;AACH,MAAa,OAA8C,SAAQ,wBAAoB;IACrF,YAAY,OAAmC;QAC7C,uFAAuF;QACvF,KAAK,CAAC;YACJ,OAAO,EAAE,EAAE;YACX,GAAG,EAAE,GAAG,EAAE;gBACR,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;gBAC9B,8CAA8C;YAChD,CAAC;YACD,GAAG,OAAO;SACX,CAAC,CAAA;IACJ,CAAC;CACF;AAZD,0BAYC;AAED;;;;GAIG;AACH,SAAgB,OAAO,CACrB,OAAmC;IAEnC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;AAC7B,CAAC;AAJD,0BAIC"}