yargs
Advanced tools
Comparing version 17.6.2 to 17.7.0
@@ -157,2 +157,3 @@ import { isCommandBuilderCallback } from './command.js'; | ||
completeOptionKey(key, completions, current) { | ||
var _a, _b, _c; | ||
const descs = this.usage.getDescriptions(); | ||
@@ -166,5 +167,12 @@ const startsByTwoDashes = (s) => /^--/.test(s); | ||
else { | ||
const desc = descs[key] || ''; | ||
const aliasKey = (_a = this === null || this === void 0 ? void 0 : this.aliases) === null || _a === void 0 ? void 0 : _a[key].find(alias => { | ||
const desc = descs[alias]; | ||
return typeof desc === 'string' && desc.length > 0; | ||
}); | ||
const descFromAlias = aliasKey ? descs[aliasKey] : undefined; | ||
const desc = (_c = (_b = descs[key]) !== null && _b !== void 0 ? _b : descFromAlias) !== null && _c !== void 0 ? _c : ''; | ||
completions.push(dashes + | ||
`${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`); | ||
`${key.replace(/:/g, '\\:')}:${desc | ||
.replace('__yargsString__:', '') | ||
.replace(/(\r\n|\n|\r)/gm, ' ')}`); | ||
} | ||
@@ -171,0 +179,0 @@ } |
@@ -349,3 +349,5 @@ import { objFilter } from './utils/obj-filter.js'; | ||
}, desc); | ||
if (extra) | ||
const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()['hide-types'] === | ||
true; | ||
if (extra && !shouldHideOptionExtras) | ||
ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' }); | ||
@@ -352,0 +354,0 @@ else |
@@ -36,2 +36,6 @@ { | ||
}, | ||
"Unknown command: %s": { | ||
"one": "Unknown command: %s", | ||
"other": "Unknown commands: %s" | ||
}, | ||
"Invalid values:": "Invalid values:", | ||
@@ -38,0 +42,0 @@ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s", |
{ | ||
"name": "yargs", | ||
"version": "17.6.2", | ||
"version": "17.7.0", | ||
"description": "yargs the modern, pirate-themed, successor to optimist.", | ||
@@ -5,0 +5,0 @@ "main": "./index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
292166
62
5273