massarg 2.0.0-pre.9 → 2.0.1

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/option.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { ArgsObject } from './command';
3
- export declare const OptionConfig: <OptionType, Args extends ArgsObject = ArgsObject>(type: z.ZodType<OptionType, z.ZodTypeDef, OptionType>) => z.ZodObject<{
3
+ export declare const OptionConfig: <OptionType, Args extends ArgsObject = ArgsObject>(type: z.ZodType<OptionType>) => z.ZodObject<{
4
4
  /** Name of the option */
5
5
  name: z.ZodString;
6
6
  /** Description of the option, displayed in the help output */
@@ -42,36 +42,85 @@ export declare const OptionConfig: <OptionType, Args extends ArgsObject = ArgsOb
42
42
  description: string;
43
43
  aliases: string[];
44
44
  defaultValue?: any;
45
- parse?: Parser<Args, OptionType> | undefined;
46
45
  array?: boolean | undefined;
47
46
  required?: boolean | undefined;
48
47
  isDefault?: boolean | undefined;
49
48
  hidden?: boolean | undefined;
50
49
  outputName?: string | undefined;
50
+ parse?: Parser<Args, OptionType> | undefined;
51
51
  }, {
52
52
  name: string;
53
53
  description: string;
54
54
  aliases: string[];
55
55
  defaultValue?: any;
56
- parse?: Parser<Args, OptionType> | undefined;
57
56
  array?: boolean | undefined;
58
57
  required?: boolean | undefined;
59
58
  isDefault?: boolean | undefined;
60
59
  hidden?: boolean | undefined;
61
60
  outputName?: string | undefined;
61
+ parse?: Parser<Args, OptionType> | undefined;
62
62
  }>;
63
63
  export type OptionConfig<T = unknown, Args extends ArgsObject = ArgsObject> = z.infer<ReturnType<typeof OptionConfig<T, Args>>>;
64
- export declare const FlagConfig: z.ZodObject<{
64
+ /**
65
+ * Configuration for a flag (boolean argument) that can be passed to a command.
66
+ */
67
+ export declare const FlagConfig: z.ZodObject<z.objectUtil.extendShape<Omit<{
68
+ /** Name of the option */
65
69
  name: z.ZodString;
70
+ /** Description of the option, displayed in the help output */
66
71
  description: z.ZodString;
72
+ /** Default value of the option */
67
73
  defaultValue: z.ZodOptional<z.ZodAny>;
74
+ /** Aliases for the option, which can be used with the shorthand option notation. */
68
75
  aliases: z.ZodArray<z.ZodString, "many">;
76
+ /**
77
+ * Parse the value of the option. You can return any type here, or throw an error if the value
78
+ * is invalid.
79
+ */
80
+ parse: z.ZodOptional<z.ZodType<Parser<ArgsObject, boolean>, z.ZodTypeDef, Parser<ArgsObject, boolean>>>;
81
+ /**
82
+ * Whether the option is an array.
83
+ *
84
+ * Array options can be specified multiple times, and the values will be collected into an array.
85
+ *
86
+ * Normally, specifying an option multiple times will override the previous value.
87
+ */
69
88
  array: z.ZodOptional<z.ZodBoolean>;
89
+ /** Whether the option is required. If it is required, parsing will throw an error if it's not
90
+ * present.
91
+ */
70
92
  required: z.ZodOptional<z.ZodBoolean>;
93
+ /** Whether the option is the default option. The default option is the option that is used if
94
+ * no other option is specified, e.g. a value is passed in without an option name.
95
+ *
96
+ * Note that if commands match the same argument first, they will be used instead of the default
97
+ * option.
98
+ */
99
+ isDefault: z.ZodOptional<z.ZodBoolean>;
100
+ /** Whether the option is hidden. Hidden options are not displayed in the help output. */
71
101
  hidden: z.ZodOptional<z.ZodBoolean>;
102
+ /** Specify a custom name for the output, which will be used when parsing the args. */
72
103
  outputName: z.ZodOptional<z.ZodString>;
104
+ }, "isDefault" | "parse">, {
105
+ /** Whether the flag can be negated, e.g. `--no-verbose` */
73
106
  negatable: z.ZodOptional<z.ZodBoolean>;
74
- }, "strip", z.ZodTypeAny, {
107
+ /**
108
+ * Negation name of the option, which can be used with the full option notation.
109
+ *
110
+ * Defaults to `no-{name}` of your option's name, e.g. `verbose` becomes `--no-verbose`.
111
+ *
112
+ * To use this, you must set `negatable: true` in the option's configuration.
113
+ */
114
+ negationName: z.ZodOptional<z.ZodString>;
115
+ /**
116
+ * Negation aliases for the option, which can be used with the shorthand option notation.
117
+ *
118
+ * Defaults to uppercase of each of the aliases provided, e.g. `q` becomes `-Q`.
119
+ *
120
+ * To use this, you must set `negatable: true` in the option's configuration.
121
+ */
122
+ negationAliases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
123
+ }>, "strip", z.ZodTypeAny, {
75
124
  name: string;
76
125
  description: string;
77
126
  aliases: string[];
@@ -81,6 +130,8 @@ export declare const FlagConfig: z.ZodObject<{
81
130
  hidden?: boolean | undefined;
82
131
  outputName?: string | undefined;
83
132
  negatable?: boolean | undefined;
133
+ negationName?: string | undefined;
134
+ negationAliases?: string[] | undefined;
84
135
  }, {
85
136
  name: string;
86
137
  description: string;
@@ -91,25 +142,59 @@ export declare const FlagConfig: z.ZodObject<{
91
142
  hidden?: boolean | undefined;
92
143
  outputName?: string | undefined;
93
144
  negatable?: boolean | undefined;
145
+ negationName?: string | undefined;
146
+ negationAliases?: string[] | undefined;
94
147
  }>;
95
148
  export type FlagConfig = z.infer<typeof FlagConfig>;
149
+ /**
150
+ * A function that parses an option value.
151
+ */
96
152
  export type Parser<Args extends ArgsObject = ArgsObject, OptionType extends any = any> = (x: string, y: Args) => OptionType;
97
- export declare const TypedOptionConfig: <OptionType, Args extends ArgsObject = ArgsObject>(type: z.ZodType<OptionType, z.ZodTypeDef, OptionType>) => z.ZodObject<{
153
+ /** {@link OptionConfig} with a specified value type */
154
+ export declare const TypedOptionConfig: <OptionType, Args extends ArgsObject = ArgsObject>(type: z.ZodType<OptionType>) => z.ZodObject<z.objectUtil.extendShape<{
155
+ /** Name of the option */
98
156
  name: z.ZodString;
157
+ /** Description of the option, displayed in the help output */
99
158
  description: z.ZodString;
159
+ /** Default value of the option */
100
160
  defaultValue: z.ZodOptional<z.ZodAny>;
161
+ /** Aliases for the option, which can be used with the shorthand option notation. */
101
162
  aliases: z.ZodArray<z.ZodString, "many">;
163
+ /**
164
+ * Parse the value of the option. You can return any type here, or throw an error if the value
165
+ * is invalid.
166
+ */
167
+ parse: z.ZodOptional<z.ZodType<Parser<Args, OptionType>, z.ZodTypeDef, Parser<Args, OptionType>>>;
168
+ /**
169
+ * Whether the option is an array.
170
+ *
171
+ * Array options can be specified multiple times, and the values will be collected into an array.
172
+ *
173
+ * Normally, specifying an option multiple times will override the previous value.
174
+ */
102
175
  array: z.ZodOptional<z.ZodBoolean>;
176
+ /** Whether the option is required. If it is required, parsing will throw an error if it's not
177
+ * present.
178
+ */
103
179
  required: z.ZodOptional<z.ZodBoolean>;
180
+ /** Whether the option is the default option. The default option is the option that is used if
181
+ * no other option is specified, e.g. a value is passed in without an option name.
182
+ *
183
+ * Note that if commands match the same argument first, they will be used instead of the default
184
+ * option.
185
+ */
104
186
  isDefault: z.ZodOptional<z.ZodBoolean>;
187
+ /** Whether the option is hidden. Hidden options are not displayed in the help output. */
105
188
  hidden: z.ZodOptional<z.ZodBoolean>;
189
+ /** Specify a custom name for the output, which will be used when parsing the args. */
106
190
  outputName: z.ZodOptional<z.ZodString>;
107
- parse: z.ZodOptional<z.ZodType<Parser<Args, OptionType>, z.ZodTypeDef, Parser<Args, OptionType>>>;
191
+ }, {
108
192
  type: z.ZodOptional<z.ZodEnum<["number"]>>;
109
- }, "strip", z.ZodTypeAny, {
193
+ }>, "strip", z.ZodTypeAny, {
110
194
  name: string;
111
195
  description: string;
112
196
  aliases: string[];
197
+ type?: "number" | undefined;
113
198
  defaultValue?: any;
114
199
  array?: boolean | undefined;
115
200
  required?: boolean | undefined;
@@ -117,11 +202,11 @@ export declare const TypedOptionConfig: <OptionType, Args extends ArgsObject = A
117
202
  hidden?: boolean | undefined;
118
203
  outputName?: string | undefined;
119
204
  parse?: Parser<Args, OptionType> | undefined;
120
- type?: "number" | undefined;
121
205
  }, {
122
206
  name: string;
123
207
  description: string;
124
208
  aliases: string[];
209
+ type?: "number" | undefined;
125
210
  defaultValue?: any;
126
211
  array?: boolean | undefined;
127
212
  required?: boolean | undefined;
@@ -129,49 +214,77 @@ export declare const TypedOptionConfig: <OptionType, Args extends ArgsObject = A
129
214
  hidden?: boolean | undefined;
130
215
  outputName?: string | undefined;
131
216
  parse?: Parser<Args, OptionType> | undefined;
132
- type?: "number" | undefined;
133
217
  }>;
134
218
  export type TypedOptionConfig<T, A extends ArgsObject = ArgsObject> = z.infer<ReturnType<typeof TypedOptionConfig<T, A>>>;
135
219
  /**
136
220
  * @see OptionConfig
137
221
  * @see ArrayOptionConfig
138
222
  */
139
- export declare const ArrayOptionConfig: <T, A extends ArgsObject = ArgsObject>(type: z.ZodType<T, z.ZodTypeDef, T>) => z.ZodObject<{
140
- type: z.ZodOptional<z.ZodEnum<["number"]>>;
223
+ export declare const ArrayOptionConfig: <T, A extends ArgsObject = ArgsObject>(type: z.ZodType<T>) => z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
224
+ /** Name of the option */
141
225
  name: z.ZodString;
226
+ /** Description of the option, displayed in the help output */
142
227
  description: z.ZodString;
228
+ /** Default value of the option */
229
+ defaultValue: z.ZodOptional<z.ZodAny>;
230
+ /** Aliases for the option, which can be used with the shorthand option notation. */
143
231
  aliases: z.ZodArray<z.ZodString, "many">;
232
+ /**
233
+ * Parse the value of the option. You can return any type here, or throw an error if the value
234
+ * is invalid.
235
+ */
236
+ parse: z.ZodOptional<z.ZodType<Parser<A, T[]>, z.ZodTypeDef, Parser<A, T[]>>>;
237
+ /**
238
+ * Whether the option is an array.
239
+ *
240
+ * Array options can be specified multiple times, and the values will be collected into an array.
241
+ *
242
+ * Normally, specifying an option multiple times will override the previous value.
243
+ */
144
244
  array: z.ZodOptional<z.ZodBoolean>;
245
+ /** Whether the option is required. If it is required, parsing will throw an error if it's not
246
+ * present.
247
+ */
145
248
  required: z.ZodOptional<z.ZodBoolean>;
249
+ /** Whether the option is the default option. The default option is the option that is used if
250
+ * no other option is specified, e.g. a value is passed in without an option name.
251
+ *
252
+ * Note that if commands match the same argument first, they will be used instead of the default
253
+ * option.
254
+ */
146
255
  isDefault: z.ZodOptional<z.ZodBoolean>;
256
+ /** Whether the option is hidden. Hidden options are not displayed in the help output. */
147
257
  hidden: z.ZodOptional<z.ZodBoolean>;
258
+ /** Specify a custom name for the output, which will be used when parsing the args. */
148
259
  outputName: z.ZodOptional<z.ZodString>;
149
- parse: z.ZodOptional<z.ZodType<Parser<A, T[]>, z.ZodTypeDef, Parser<A, T[]>>>;
260
+ }, {
261
+ type: z.ZodOptional<z.ZodEnum<["number"]>>;
262
+ }>, {
150
263
  defaultValue: z.ZodOptional<z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">>;
151
- }, "strip", z.ZodTypeAny, {
264
+ }>, "strip", z.ZodTypeAny, {
152
265
  name: string;
153
266
  description: string;
154
267
  aliases: string[];
155
268
  type?: "number" | undefined;
269
+ defaultValue?: T[] | undefined;
156
270
  array?: boolean | undefined;
157
271
  required?: boolean | undefined;
158
272
  isDefault?: boolean | undefined;
159
273
  hidden?: boolean | undefined;
160
274
  outputName?: string | undefined;
161
275
  parse?: Parser<A, T[]> | undefined;
162
- defaultValue?: T[] | undefined;
163
276
  }, {
164
277
  name: string;
165
278
  description: string;
166
279
  aliases: string[];
167
280
  type?: "number" | undefined;
281
+ defaultValue?: T[] | undefined;
168
282
  array?: boolean | undefined;
169
283
  required?: boolean | undefined;
170
284
  isDefault?: boolean | undefined;
171
285
  hidden?: boolean | undefined;
172
286
  outputName?: string | undefined;
173
287
  parse?: Parser<A, T[]> | undefined;
174
- defaultValue?: T[] | undefined;
175
288
  }>;
176
289
  /**
177
290
  * An option that can be passed to a command.
@@ -179,15 +292,24 @@ export declare const ArrayOptionConfig: <T, A extends ArgsObject = ArgsObject>(t
179
292
  * This type represents an array option, which can be specified multiple times.
180
293
  */
181
294
  export type ArrayOptionConfig<T = unknown> = z.infer<ReturnType<typeof ArrayOptionConfig<z.ZodType<T>>>>;
182
- export declare const OPT_FULL_PREFIX = "--";
183
- export declare const OPT_SHORT_PREFIX = "-";
184
- export declare const NEGATE_FULL_PREFIX = "--no-";
185
- export declare const NEGATE_SHORT_PREFIX = "^";
295
+ /** The default prefixes for options */
296
+ export declare const DEFAULT_OPT_FULL_PREFIX = "--";
297
+ /** The default prefix for option aliases */
298
+ export declare const DEFAULT_OPT_SHORT_PREFIX = "-";
186
299
  export type Prefixes = {
187
- optionPrefix: string;
300
+ normalPrefix: string;
188
301
  aliasPrefix: string;
189
- negateFlagPrefix: string;
190
- negateAliasPrefix: string;
302
+ };
303
+ export type Names = {
304
+ name: string;
305
+ aliases: string[];
306
+ };
307
+ /** Names with prefixes built-in */
308
+ export type QualifiedNames = {
309
+ name: string;
310
+ aliases: string[];
311
+ negationName: string;
312
+ negationAliases: string[];
191
313
  };
192
314
  /** @internal */
193
315
  export type ArgvValue<T> = {
@@ -223,23 +345,37 @@ export declare class MassargOption<OptionType extends any = unknown, Args extend
223
345
  defaultValue?: OptionType;
224
346
  aliases: string[];
225
347
  parse: Parser<Args, OptionType>;
348
+ /**
349
+ * Whether this option can be used multiple times. Any passed values will end up in an array
350
+ * instead of each usage overwriting the existing value.
351
+ */
226
352
  isArray: boolean;
353
+ /** Whether this option is required. Failing to specify this option will throw an error. */
227
354
  isRequired: boolean;
228
355
  isDefault: boolean;
229
356
  outputName?: string;
230
357
  constructor(options: OptionConfig<OptionType, Args>);
358
+ /**
359
+ * Create a typed option from a configuration. Currently supports `number` options which
360
+ * are automatically transformed from `string` to `number`.
361
+ */
231
362
  static fromTypedConfig<T = unknown, A extends ArgsObject = ArgsObject>(config: TypedOptionConfig<T, A>): MassargOption<T>;
363
+ /**
364
+ * Returns the key which this option outputs to in the final object.
365
+ *
366
+ * @default The camelCase version of this option's name.
367
+ *
368
+ * Can be overridden with {@link outputName}.
369
+ */
232
370
  getOutputName(): string;
371
+ /** @internal */
233
372
  parseDetails(argv: string[], options: ArgsObject, prefixes: Prefixes): ArgvValue<OptionType>;
373
+ /** Get the help string for this option */
234
374
  helpString(): string;
235
375
  /** Returns true if the flag (including any prefixes) matches the name or aliases */
236
376
  isMatch(arg: string, prefixes: Prefixes): boolean;
237
- /**
238
- * Returns the name of the flag, removing any prefixes. It is discriminate of if the option
239
- * exists, as it is a static method; it only returns the name of the flag if it matches the
240
- * prefixes format.
241
- */
242
- static findNameInArg(arg: string, prefixes: Prefixes): string;
377
+ /** Return the finalized names that will cause this option to match. */
378
+ qualifiedNames(prefixes: Prefixes): QualifiedNames;
243
379
  }
244
380
  /**
245
381
  * An option that can be passed to a command.
@@ -262,15 +398,16 @@ export declare class MassargNumber extends MassargOption<number> {
262
398
  parseDetails(argv: string[], options: ArgsObject, prefixes: Prefixes): ArgvValue<number>;
263
399
  }
264
400
  /**
265
- * An option that can be passed to a command.
401
+ * A boolean option that can be passed to a command.
266
402
  *
267
403
  * A flag is an option that is either present or not. It can be used to toggle
268
404
  * a boolean value, or to indicate that a command should be run in a different
269
405
  * mode.
270
406
  *
271
- * A flag can be negated by prefixing it with `no-`. For example, `--no-verbose`,
272
- * or by prefixing the alias with `^` instead of `-`. This is configurable via the command's
273
- * configuration. To turn this behavior on, set `negatable: true` in the flag's configuration.
407
+ * A flag can be negated by using `negatable: true`. By default, the negated name is the same
408
+ * as the option name, prefixed by `no-`, and each of the aliases will be uppercased.
409
+ * For example, `--verbose` and `--no-verbose`, or `-v` and `-V`.
410
+ * This behavior can be overridden by the `negatedName` and `negatedAliases` options.
274
411
  *
275
412
  * @example
276
413
  * ```ts
@@ -283,10 +420,17 @@ export declare class MassargNumber extends MassargOption<number> {
283
420
  * ```
284
421
  */
285
422
  export declare class MassargFlag extends MassargOption<boolean> {
423
+ /** Whether this flag may be negated using `negationName` or `negationAliases`. */
286
424
  negatable: boolean;
425
+ /** The negation name of this flag, which can be used with the full option notation. */
426
+ negationName: string;
427
+ /** The negation aliases of this flag, which can be used with the shorthand option notation. */
428
+ negationAliases: string[];
287
429
  constructor(options: FlagConfig);
288
430
  parseDetails(argv: string[], _options: ArgsObject, prefixes: Prefixes): ArgvValue<boolean>;
431
+ qualifiedNames(prefixes: Prefixes): QualifiedNames;
289
432
  }
433
+ /** A flag that can be passed to a command to show the help message. */
290
434
  export declare class MassargHelpFlag extends MassargFlag {
291
435
  constructor(config?: Partial<Omit<OptionConfig<boolean>, 'parse'>>);
292
436
  }
package/option.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"option.d.ts","sourceRoot":"","sources":["../src/option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAEtC,eAAO,MAAM,YAAY;IAIrB,yBAAyB;;IAEzB,8DAA8D;;IAE9D,kCAAkC;;IAElC,oFAAoF;;IAEpF;;;OAGG;;IAIH;;;;;;OAMG;;IAEH;;OAEG;;IAEH;;;;;OAKG;;IAEH,yFAAyF;;IAEzF,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;EAEtF,CAAA;AACJ,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,SAAS,UAAU,GAAG,UAAU,IAAI,CAAC,CAAC,KAAK,CACnF,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CACzC,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOpB,CAAA;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAEnD,MAAM,MAAM,MAAM,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,EAAE,UAAU,SAAS,GAAG,GAAG,GAAG,IAAI,CACvF,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,IAAI,KACJ,UAAU,CAAA;AAEf,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO3B,CAAA;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,CAAC,CAAC,KAAK,CAC3E,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAC3C,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vE"}
package/option.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MassargHelpFlag = exports.MassargFlag = exports.MassargNumber = exports.MassargOption = exports.NEGATE_SHORT_PREFIX = exports.NEGATE_FULL_PREFIX = exports.OPT_SHORT_PREFIX = exports.OPT_FULL_PREFIX = exports.ArrayOptionConfig = exports.TypedOptionConfig = exports.FlagConfig = exports.OptionConfig = void 0;
3
+ exports.MassargHelpFlag = exports.MassargFlag = exports.MassargNumber = exports.MassargOption = exports.DEFAULT_OPT_SHORT_PREFIX = exports.DEFAULT_OPT_FULL_PREFIX = exports.ArrayOptionConfig = exports.TypedOptionConfig = exports.FlagConfig = exports.OptionConfig = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const error_1 = require("./error");
6
6
  const utils_1 = require("./utils");
@@ -43,12 +43,32 @@ const OptionConfig = (type) => zod_1.z.object({
43
43
  outputName: zod_1.z.string().optional(),
44
44
  });
45
45
  exports.OptionConfig = OptionConfig;
46
+ /**
47
+ * Configuration for a flag (boolean argument) that can be passed to a command.
48
+ */
46
49
  exports.FlagConfig = (0, exports.OptionConfig)(zod_1.z.any())
47
50
  .omit({ parse: true, isDefault: true })
48
51
  .merge(zod_1.z.object({
49
52
  /** Whether the flag can be negated, e.g. `--no-verbose` */
50
53
  negatable: zod_1.z.boolean().optional(),
54
+ /**
55
+ * Negation name of the option, which can be used with the full option notation.
56
+ *
57
+ * Defaults to `no-{name}` of your option's name, e.g. `verbose` becomes `--no-verbose`.
58
+ *
59
+ * To use this, you must set `negatable: true` in the option's configuration.
60
+ */
61
+ negationName: zod_1.z.string().optional(),
62
+ /**
63
+ * Negation aliases for the option, which can be used with the shorthand option notation.
64
+ *
65
+ * Defaults to uppercase of each of the aliases provided, e.g. `q` becomes `-Q`.
66
+ *
67
+ * To use this, you must set `negatable: true` in the option's configuration.
68
+ */
69
+ negationAliases: zod_1.z.string().array().optional(),
51
70
  }));
71
+ /** {@link OptionConfig} with a specified value type */
52
72
  const TypedOptionConfig = (type) => (0, exports.OptionConfig)(type).merge(zod_1.z.object({
53
73
  type: zod_1.z.enum(['number']).optional(),
54
74
  }));
@@ -63,11 +83,10 @@ zod_1.z.object({
63
83
  defaultValue: zod_1.z.array(type).optional(),
64
84
  }));
65
85
  exports.ArrayOptionConfig = ArrayOptionConfig;
66
- // TODO turn to options
67
- exports.OPT_FULL_PREFIX = '--';
68
- exports.OPT_SHORT_PREFIX = '-';
69
- exports.NEGATE_FULL_PREFIX = '--no-';
70
- exports.NEGATE_SHORT_PREFIX = '^';
86
+ /** The default prefixes for options */
87
+ exports.DEFAULT_OPT_FULL_PREFIX = '--';
88
+ /** The default prefix for option aliases */
89
+ exports.DEFAULT_OPT_SHORT_PREFIX = '-';
71
90
  /**
72
91
  * An option that can be passed to a command.
73
92
  *
@@ -103,6 +122,10 @@ class MassargOption {
103
122
  this.isRequired = options.required ?? false;
104
123
  this.outputName = options.outputName;
105
124
  }
125
+ /**
126
+ * Create a typed option from a configuration. Currently supports `number` options which
127
+ * are automatically transformed from `string` to `number`.
128
+ */
106
129
  static fromTypedConfig(config) {
107
130
  switch (config.type) {
108
131
  case 'number':
@@ -110,9 +133,17 @@ class MassargOption {
110
133
  }
111
134
  return new MassargOption(config);
112
135
  }
136
+ /**
137
+ * Returns the key which this option outputs to in the final object.
138
+ *
139
+ * @default The camelCase version of this option's name.
140
+ *
141
+ * Can be overridden with {@link outputName}.
142
+ */
113
143
  getOutputName() {
114
144
  return this.outputName || (0, utils_1.toCamelCase)(this.name);
115
145
  }
146
+ /** @internal */
116
147
  parseDetails(argv, options, prefixes) {
117
148
  let input = '';
118
149
  try {
@@ -141,38 +172,27 @@ class MassargOption {
141
172
  throw e;
142
173
  }
143
174
  }
175
+ /** Get the help string for this option */
144
176
  helpString() {
145
177
  const aliases = this.aliases.length ? `|${this.aliases.join('|-')}` : '';
146
178
  return `--${this.name}${aliases} ${this.description}`;
147
179
  }
148
180
  /** Returns true if the flag (including any prefixes) matches the name or aliases */
149
181
  isMatch(arg, prefixes) {
150
- const name = MassargOption.findNameInArg(arg, prefixes);
151
- return name === this.name || this.aliases.includes(name);
182
+ const qualifiedNames = this.qualifiedNames(prefixes);
183
+ return (arg === qualifiedNames.name ||
184
+ arg === qualifiedNames.negationName ||
185
+ qualifiedNames.aliases.includes(arg) ||
186
+ qualifiedNames.negationAliases.includes(arg));
152
187
  }
153
- /**
154
- * Returns the name of the flag, removing any prefixes. It is discriminate of if the option
155
- * exists, as it is a static method; it only returns the name of the flag if it matches the
156
- * prefixes format.
157
- */
158
- static findNameInArg(arg, prefixes) {
159
- const { optionPrefix, aliasPrefix, negateFlagPrefix, negateAliasPrefix } = prefixes;
160
- // negate full prefix
161
- if (arg.startsWith(negateFlagPrefix)) {
162
- return arg.slice(negateFlagPrefix.length);
163
- }
164
- if (arg.startsWith(optionPrefix)) {
165
- return arg.slice(optionPrefix.length);
166
- }
167
- // negate short prefix
168
- if (arg.startsWith(negateAliasPrefix)) {
169
- return arg.slice(negateAliasPrefix.length);
170
- }
171
- // short prefix
172
- if (arg.startsWith(aliasPrefix) || arg.startsWith(negateAliasPrefix)) {
173
- return arg.slice(aliasPrefix.length);
174
- }
175
- return '<blank>';
188
+ /** Return the finalized names that will cause this option to match. */
189
+ qualifiedNames(prefixes) {
190
+ return {
191
+ name: prefixes.normalPrefix + this.name,
192
+ aliases: this.aliases.map((a) => prefixes.aliasPrefix + a),
193
+ negationName: '',
194
+ negationAliases: [],
195
+ };
176
196
  }
177
197
  }
178
198
  exports.MassargOption = MassargOption;
@@ -227,15 +247,16 @@ class MassargNumber extends MassargOption {
227
247
  }
228
248
  exports.MassargNumber = MassargNumber;
229
249
  /**
230
- * An option that can be passed to a command.
250
+ * A boolean option that can be passed to a command.
231
251
  *
232
252
  * A flag is an option that is either present or not. It can be used to toggle
233
253
  * a boolean value, or to indicate that a command should be run in a different
234
254
  * mode.
235
255
  *
236
- * A flag can be negated by prefixing it with `no-`. For example, `--no-verbose`,
237
- * or by prefixing the alias with `^` instead of `-`. This is configurable via the command's
238
- * configuration. To turn this behavior on, set `negatable: true` in the flag's configuration.
256
+ * A flag can be negated by using `negatable: true`. By default, the negated name is the same
257
+ * as the option name, prefixed by `no-`, and each of the aliases will be uppercased.
258
+ * For example, `--verbose` and `--no-verbose`, or `-v` and `-V`.
259
+ * This behavior can be overridden by the `negatedName` and `negatedAliases` options.
239
260
  *
240
261
  * @example
241
262
  * ```ts
@@ -254,11 +275,14 @@ class MassargFlag extends MassargOption {
254
275
  parse: () => true,
255
276
  });
256
277
  this.negatable = options.negatable ?? false;
278
+ this.negationName = options.negationName ?? `no-${options.name}`;
279
+ this.negationAliases = options.negationAliases ?? this.aliases.map((a) => a.toUpperCase());
257
280
  }
258
281
  parseDetails(argv, _options, prefixes) {
259
282
  try {
260
- const isNegation = argv[0]?.startsWith(prefixes.negateAliasPrefix) ||
261
- argv[0]?.startsWith(prefixes.negateFlagPrefix);
283
+ const qualifiedNames = this.qualifiedNames(prefixes);
284
+ const isNegation = (qualifiedNames.negationName && argv[0] === qualifiedNames.negationName) ||
285
+ (qualifiedNames.negationAliases.length && qualifiedNames.negationAliases.includes(argv[0]));
262
286
  if (!this.negatable && isNegation) {
263
287
  throw new error_1.ParseError({
264
288
  path: [this.name],
@@ -292,8 +316,16 @@ class MassargFlag extends MassargOption {
292
316
  throw e;
293
317
  }
294
318
  }
319
+ qualifiedNames(prefixes) {
320
+ return {
321
+ ...super.qualifiedNames(prefixes),
322
+ negationName: prefixes.normalPrefix + this.negationName,
323
+ negationAliases: this.negationAliases.map((a) => prefixes.aliasPrefix + a),
324
+ };
325
+ }
295
326
  }
296
327
  exports.MassargFlag = MassargFlag;
328
+ /** A flag that can be passed to a command to show the help message. */
297
329
  class MassargHelpFlag extends MassargFlag {
298
330
  constructor(config = {}) {
299
331
  super({
package/option.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"option.js","sourceRoot":"","sources":["../src/option.ts"],"names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