@oclif/core 3.23.1 → 3.24.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/command.js +2 -1
- package/lib/help/docopts.d.ts +2 -2
- package/lib/help/docopts.js +3 -1
- package/package.json +1 -1
package/lib/help/command.js
CHANGED
|
@@ -58,7 +58,8 @@ class CommandHelp extends formatter_1.HelpFormatter {
|
|
|
58
58
|
if (args.filter((a) => a.description).length === 0)
|
|
59
59
|
return;
|
|
60
60
|
return args.map((a) => {
|
|
61
|
-
|
|
61
|
+
// Add ellipsis to indicate that the argument takes multiple values if strict is false
|
|
62
|
+
const name = this.command.strict === false ? `${a.name.toUpperCase()}...` : a.name.toUpperCase();
|
|
62
63
|
let description = a.description || '';
|
|
63
64
|
if (a.default)
|
|
64
65
|
description = `${(0, theme_1.colorize)(this.config?.theme?.flagDefaultValue, `[default: ${a.default}]`)} ${description}`;
|
package/lib/help/docopts.d.ts
CHANGED
|
@@ -59,8 +59,8 @@ export declare class DocOpts {
|
|
|
59
59
|
private cmd;
|
|
60
60
|
private flagList;
|
|
61
61
|
private flagMap;
|
|
62
|
-
constructor(cmd: Command.
|
|
63
|
-
static generate(cmd: Command.
|
|
62
|
+
constructor(cmd: Command.Loadable);
|
|
63
|
+
static generate(cmd: Command.Loadable): string;
|
|
64
64
|
toString(): string;
|
|
65
65
|
private combineElementsToFlag;
|
|
66
66
|
private generateElements;
|
package/lib/help/docopts.js
CHANGED
|
@@ -79,7 +79,9 @@ class DocOpts {
|
|
|
79
79
|
toString() {
|
|
80
80
|
const opts = ['<%= command.id %>'];
|
|
81
81
|
if (this.cmd.args) {
|
|
82
|
-
|
|
82
|
+
// If strict is false, add ellipsis to indicate that the argument takes multiple values
|
|
83
|
+
const suffix = this.cmd.strict === false ? '...' : '';
|
|
84
|
+
const a = Object.values((0, ensure_arg_object_1.ensureArgObject)(this.cmd.args)).map((arg) => arg.required ? `${arg.name.toUpperCase()}${suffix}` : `[${arg.name.toUpperCase()}${suffix}]`) || [];
|
|
83
85
|
opts.push(...a);
|
|
84
86
|
}
|
|
85
87
|
try {
|