@oclif/core 2.0.9 → 2.0.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/lib/parser/parse.js +7 -2
- package/package.json +6 -6
package/lib/parser/parse.js
CHANGED
|
@@ -189,13 +189,18 @@ class Parser {
|
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
191
|
const input = token.input;
|
|
192
|
-
this._validateOptions(flag, input);
|
|
193
192
|
if (flag.delimiter && flag.multiple) {
|
|
194
|
-
|
|
193
|
+
// split, trim, and remove surrounding doubleQuotes (which would hav been needed if the elements contain spaces)
|
|
194
|
+
const values = await Promise.all(input.split(flag.delimiter).map(async (v) => this._parseFlag(v.trim().replace(/^"(.*)"$/, '$1').replace(/^'(.*)'$/, '$1'), flag, token)));
|
|
195
|
+
// then parse that each element aligns with the `options` property
|
|
196
|
+
for (const v of values) {
|
|
197
|
+
this._validateOptions(flag, v);
|
|
198
|
+
}
|
|
195
199
|
flags[token.flag] = flags[token.flag] || [];
|
|
196
200
|
flags[token.flag].push(...values);
|
|
197
201
|
}
|
|
198
202
|
else {
|
|
203
|
+
this._validateOptions(flag, input);
|
|
199
204
|
const value = await this._parseFlag(input, flag, token);
|
|
200
205
|
if (flag.multiple) {
|
|
201
206
|
flags[token.flag] = flags[token.flag] || [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/core",
|
|
3
3
|
"description": "base library for oclif CLIs",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.11",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/core/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"strip-ansi": "^6.0.1",
|
|
30
30
|
"supports-color": "^8.1.1",
|
|
31
31
|
"supports-hyperlinks": "^2.2.0",
|
|
32
|
-
"tslib": "^2.
|
|
32
|
+
"tslib": "^2.5.0",
|
|
33
33
|
"widest-line": "^3.1.0",
|
|
34
34
|
"wordwrap": "^1.0.0",
|
|
35
35
|
"wrap-ansi": "^7.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@commitlint/config-conventional": "^12.1.4",
|
|
39
|
-
"@oclif/plugin-help": "^5.
|
|
40
|
-
"@oclif/plugin-plugins": "^2.
|
|
41
|
-
"@oclif/test": "^2.
|
|
39
|
+
"@oclif/plugin-help": "^5.2.4",
|
|
40
|
+
"@oclif/plugin-plugins": "^2.3.0",
|
|
41
|
+
"@oclif/test": "^2.3.5",
|
|
42
42
|
"@types/ansi-styles": "^3.2.1",
|
|
43
43
|
"@types/chai": "^4.3.4",
|
|
44
44
|
"@types/chai-as-promised": "^7.1.5",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"posttest": "yarn lint",
|
|
111
111
|
"prepack": "yarn run build",
|
|
112
112
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
113
|
-
"test:e2e": "mocha \"test/**/*.e2e.ts\" --timeout 1200000",
|
|
113
|
+
"test:e2e": "mocha --forbid-only \"test/**/*.e2e.ts\" --timeout 1200000",
|
|
114
114
|
"pretest": "yarn build --noEmit && tsc -p test --noEmit --skipLibCheck"
|
|
115
115
|
},
|
|
116
116
|
"types": "lib/index.d.ts"
|