@oclif/core 3.12.0 → 3.13.0
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/lib/help/util.js +1 -1
- package/lib/interfaces/parser.d.ts +6 -0
- package/lib/parser/parse.js +1 -1
- package/package.json +1 -1
package/lib/help/util.js
CHANGED
|
@@ -43,7 +43,7 @@ function collateSpacedCmdIDFromArgs(argv, config) {
|
|
|
43
43
|
const ids = (0, util_1.collectUsableIds)(config.commandIDs);
|
|
44
44
|
const final = [];
|
|
45
45
|
const idPresent = (id) => ids.has(id);
|
|
46
|
-
const finalizeId = (s) => (s ? [...final, s]
|
|
46
|
+
const finalizeId = (s) => (s ? [...final, s] : final).filter(Boolean).join(':');
|
|
47
47
|
const hasArgs = () => {
|
|
48
48
|
const id = finalizeId();
|
|
49
49
|
if (!id)
|
|
@@ -200,6 +200,12 @@ export type OptionFlagProps = FlagProps & {
|
|
|
200
200
|
helpValue?: string;
|
|
201
201
|
options?: readonly string[];
|
|
202
202
|
multiple?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Parse one value per flag; allow `-m val1 -m val2`, disallow `-m val1 val2`.
|
|
205
|
+
* Set to true to use "multiple: true" flags together with args.
|
|
206
|
+
* Only respected if multiple is set to true.
|
|
207
|
+
*/
|
|
208
|
+
multipleNonGreedy?: boolean;
|
|
203
209
|
/**
|
|
204
210
|
* Delimiter to separate the values for a multiple value flag.
|
|
205
211
|
* Only respected if multiple is set to true. Default behavior is to
|
package/lib/parser/parse.js
CHANGED
|
@@ -145,7 +145,7 @@ class Parser {
|
|
|
145
145
|
continue;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
if (parsingFlags && this.currentFlag && this.currentFlag.multiple) {
|
|
148
|
+
if (parsingFlags && this.currentFlag && this.currentFlag.multiple && !this.currentFlag.multipleNonGreedy) {
|
|
149
149
|
this.raw.push({ flag: this.currentFlag.name, input, type: 'flag' });
|
|
150
150
|
continue;
|
|
151
151
|
}
|