@optique/core 1.0.0-dev.434 → 1.0.0-dev.438
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/dist/primitives.cjs +2 -2
- package/dist/primitives.d.cts +6 -3
- package/dist/primitives.d.ts +6 -3
- package/dist/primitives.js +2 -2
- package/package.json +1 -1
package/dist/primitives.cjs
CHANGED
|
@@ -394,7 +394,7 @@ function option(...args) {
|
|
|
394
394
|
consumed: context.buffer.slice(0, 2)
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/")).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
397
|
+
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/") || name.startsWith("-") && name.length > 2).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
398
398
|
for (const prefix of prefixes) {
|
|
399
399
|
if (!context.buffer[0].startsWith(prefix)) continue;
|
|
400
400
|
if (context.state?.success && (valueParser != null || context.state.value)) return {
|
|
@@ -626,7 +626,7 @@ function flag(...args) {
|
|
|
626
626
|
consumed: context.buffer.slice(0, 1)
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/")).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
629
|
+
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/") || name.startsWith("-") && name.length > 2).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
630
630
|
for (const prefix of prefixes) if (context.buffer[0].startsWith(prefix)) {
|
|
631
631
|
const value = context.buffer[0].slice(prefix.length);
|
|
632
632
|
return {
|
package/dist/primitives.d.cts
CHANGED
|
@@ -107,7 +107,8 @@ interface OptionErrorOptions {
|
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Creates a parser for various styles of command-line options that take an
|
|
110
|
-
* argument value, such as `--option=value`, `-
|
|
110
|
+
* argument value, such as `--option=value`, `-option=value`, `-o value`,
|
|
111
|
+
* or `/option:value`.
|
|
111
112
|
* @template M The execution mode of the parser.
|
|
112
113
|
* @template T The type of value this parser produces.
|
|
113
114
|
* @param args The {@link OptionName}s to parse, followed by
|
|
@@ -120,7 +121,8 @@ interface OptionErrorOptions {
|
|
|
120
121
|
declare function option<M extends Mode, T>(...args: readonly [...readonly OptionName[], ValueParser<M, T>]): Parser<M, T, ValueParserResult<T> | undefined>;
|
|
121
122
|
/**
|
|
122
123
|
* Creates a parser for various styles of command-line options that take an
|
|
123
|
-
* argument value, such as `--option=value`, `-
|
|
124
|
+
* argument value, such as `--option=value`, `-option=value`, `-o value`,
|
|
125
|
+
* or `/option:value`.
|
|
124
126
|
* @template M The execution mode of the parser.
|
|
125
127
|
* @template T The type of value this parser produces.
|
|
126
128
|
* @param args The {@link OptionName}s to parse, followed by
|
|
@@ -141,7 +143,8 @@ declare function option<M extends Mode, T>(...args: readonly [...readonly Option
|
|
|
141
143
|
declare function option(...optionNames: readonly OptionName[]): Parser<"sync", boolean, ValueParserResult<boolean> | undefined>;
|
|
142
144
|
/**
|
|
143
145
|
* Creates a parser for various styles of command-line options that take an
|
|
144
|
-
* argument value, such as `--option=value`, `-
|
|
146
|
+
* argument value, such as `--option=value`, `-option=value`, `-o value`,
|
|
147
|
+
* or `/option:value`.
|
|
145
148
|
* @param args The {@link OptionName}s to parse, followed by
|
|
146
149
|
* an optional {@link OptionOptions} object that allows you to
|
|
147
150
|
* specify a description or other metadata.
|
package/dist/primitives.d.ts
CHANGED
|
@@ -107,7 +107,8 @@ interface OptionErrorOptions {
|
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Creates a parser for various styles of command-line options that take an
|
|
110
|
-
* argument value, such as `--option=value`, `-
|
|
110
|
+
* argument value, such as `--option=value`, `-option=value`, `-o value`,
|
|
111
|
+
* or `/option:value`.
|
|
111
112
|
* @template M The execution mode of the parser.
|
|
112
113
|
* @template T The type of value this parser produces.
|
|
113
114
|
* @param args The {@link OptionName}s to parse, followed by
|
|
@@ -120,7 +121,8 @@ interface OptionErrorOptions {
|
|
|
120
121
|
declare function option<M extends Mode, T>(...args: readonly [...readonly OptionName[], ValueParser<M, T>]): Parser<M, T, ValueParserResult<T> | undefined>;
|
|
121
122
|
/**
|
|
122
123
|
* Creates a parser for various styles of command-line options that take an
|
|
123
|
-
* argument value, such as `--option=value`, `-
|
|
124
|
+
* argument value, such as `--option=value`, `-option=value`, `-o value`,
|
|
125
|
+
* or `/option:value`.
|
|
124
126
|
* @template M The execution mode of the parser.
|
|
125
127
|
* @template T The type of value this parser produces.
|
|
126
128
|
* @param args The {@link OptionName}s to parse, followed by
|
|
@@ -141,7 +143,8 @@ declare function option<M extends Mode, T>(...args: readonly [...readonly Option
|
|
|
141
143
|
declare function option(...optionNames: readonly OptionName[]): Parser<"sync", boolean, ValueParserResult<boolean> | undefined>;
|
|
142
144
|
/**
|
|
143
145
|
* Creates a parser for various styles of command-line options that take an
|
|
144
|
-
* argument value, such as `--option=value`, `-
|
|
146
|
+
* argument value, such as `--option=value`, `-option=value`, `-o value`,
|
|
147
|
+
* or `/option:value`.
|
|
145
148
|
* @param args The {@link OptionName}s to parse, followed by
|
|
146
149
|
* an optional {@link OptionOptions} object that allows you to
|
|
147
150
|
* specify a description or other metadata.
|
package/dist/primitives.js
CHANGED
|
@@ -394,7 +394,7 @@ function option(...args) {
|
|
|
394
394
|
consumed: context.buffer.slice(0, 2)
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/")).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
397
|
+
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/") || name.startsWith("-") && name.length > 2).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
398
398
|
for (const prefix of prefixes) {
|
|
399
399
|
if (!context.buffer[0].startsWith(prefix)) continue;
|
|
400
400
|
if (context.state?.success && (valueParser != null || context.state.value)) return {
|
|
@@ -626,7 +626,7 @@ function flag(...args) {
|
|
|
626
626
|
consumed: context.buffer.slice(0, 1)
|
|
627
627
|
};
|
|
628
628
|
}
|
|
629
|
-
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/")).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
629
|
+
const prefixes = optionNames$1.filter((name) => name.startsWith("--") || name.startsWith("/") || name.startsWith("-") && name.length > 2).map((name) => name.startsWith("/") ? `${name}:` : `${name}=`);
|
|
630
630
|
for (const prefix of prefixes) if (context.buffer[0].startsWith(prefix)) {
|
|
631
631
|
const value = context.buffer[0].slice(prefix.length);
|
|
632
632
|
return {
|