Update checked-in dependencies
This commit is contained in:
parent
4fad06f438
commit
40a500c743
4168 changed files with 298222 additions and 374905 deletions
31
node_modules/yargs/build/lib/completion.js
generated
vendored
31
node_modules/yargs/build/lib/completion.js
generated
vendored
|
|
@ -71,9 +71,7 @@ export class Completion {
|
|||
if (!isPositionalKey &&
|
||||
!options.hiddenOptions.includes(key) &&
|
||||
!this.argsContainKey(args, key, negable)) {
|
||||
this.completeOptionKey(key, completions, current);
|
||||
if (negable && !!options.default[key])
|
||||
this.completeOptionKey(`no-${key}`, completions, current);
|
||||
this.completeOptionKey(key, completions, current, negable && !!options.default[key]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -153,18 +151,27 @@ export class Completion {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
completeOptionKey(key, completions, current) {
|
||||
const descs = this.usage.getDescriptions();
|
||||
completeOptionKey(key, completions, current, negable) {
|
||||
var _a, _b, _c, _d;
|
||||
let keyWithDesc = key;
|
||||
if (this.zshShell) {
|
||||
const descs = this.usage.getDescriptions();
|
||||
const aliasKey = (_b = (_a = this === null || this === void 0 ? void 0 : this.aliases) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.find(alias => {
|
||||
const desc = descs[alias];
|
||||
return typeof desc === 'string' && desc.length > 0;
|
||||
});
|
||||
const descFromAlias = aliasKey ? descs[aliasKey] : undefined;
|
||||
const desc = (_d = (_c = descs[key]) !== null && _c !== void 0 ? _c : descFromAlias) !== null && _d !== void 0 ? _d : '';
|
||||
keyWithDesc = `${key.replace(/:/g, '\\:')}:${desc
|
||||
.replace('__yargsString__:', '')
|
||||
.replace(/(\r\n|\n|\r)/gm, ' ')}`;
|
||||
}
|
||||
const startsByTwoDashes = (s) => /^--/.test(s);
|
||||
const isShortOption = (s) => /^[^0-9]$/.test(s);
|
||||
const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--';
|
||||
if (!this.zshShell) {
|
||||
completions.push(dashes + key);
|
||||
}
|
||||
else {
|
||||
const desc = descs[key] || '';
|
||||
completions.push(dashes +
|
||||
`${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`);
|
||||
completions.push(dashes + keyWithDesc);
|
||||
if (negable) {
|
||||
completions.push(dashes + 'no-' + keyWithDesc);
|
||||
}
|
||||
}
|
||||
customCompletion(args, argv, current, done) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue