2023-09-06 14:39:31 +00:00
diff --git a/node_modules/@oclif/core/lib/cli-ux/list.js b/node_modules/@oclif/core/lib/cli-ux/list.js
2023-10-05 10:52:10 +00:00
index 607d8dc..07ba1f2 100644
2023-09-06 14:39:31 +00:00
--- a/node_modules/@oclif/core/lib/cli-ux/list.js
+++ b/node_modules/@oclif/core/lib/cli-ux/list.js
@@ -22,7 +22,7 @@ function renderList(items) {
}
left = left.padEnd(maxLength);
right = linewrap(maxLength + 2, right);
- return `${left} ${right}`;
+ return `${left} : ${right}`;
});
return lines.join('\n');
}
2023-07-06 17:02:19 +00:00
diff --git a/node_modules/@oclif/core/lib/help/command.js b/node_modules/@oclif/core/lib/help/command.js
2024-03-11 13:19:15 +00:00
index 6640bf9..22dac8a 100644
2023-07-06 17:02:19 +00:00
--- a/node_modules/@oclif/core/lib/help/command.js
+++ b/node_modules/@oclif/core/lib/help/command.js
2024-03-11 13:19:15 +00:00
@@ -59,7 +59,9 @@ class CommandHelp extends formatter_1.HelpFormatter {
2023-07-06 17:02:19 +00:00
return;
2023-10-05 10:52:10 +00:00
return args.map((a) => {
2024-03-11 13:19:15 +00:00
// Add ellipsis to indicate that the argument takes multiple values if strict is false
- const name = this.command.strict === false ? `${a.name.toUpperCase()}...` : a.name.toUpperCase();
+ let name = this.command.strict === false ? `${a.name.toUpperCase()}...` : a.name.toUpperCase();
+ name = a.required ? `<${name}>` : `[${name}]`;
+
2023-07-06 17:02:19 +00:00
let description = a.description || '';
if (a.default)
2023-12-08 13:30:08 +00:00
description = `${(0, theme_1.colorize)(this.config?.theme?.flagDefaultValue, `[default: ${a.default}]`)} ${description}`;
2024-03-11 13:19:15 +00:00
@@ -154,14 +156,12 @@ class CommandHelp extends formatter_1.HelpFormatter {
2024-01-17 11:43:14 +00:00
label = labels.join(flag.char ? (0, theme_1.colorize)(this.config?.theme?.flagSeparator, ', ') : ' ');
2023-07-06 17:02:19 +00:00
}
if (flag.type === 'option') {
- let value = flag.helpValue || (this.opts.showFlagNameInTitle ? flag.name : '<value>');
+ let value = flag.helpValue || (this.opts.showFlagNameInTitle ? flag.name : `<${flag.name}>`);
if (!flag.helpValue && flag.options) {
value = showOptions || this.opts.showFlagOptionsInTitle ? `${flag.options.join('|')}` : '<option>';
}
if (flag.multiple)
- value += '...';
- if (!value.includes('|'))
2023-10-05 10:52:10 +00:00
- value = chalk_1.default.underline(value);
2023-07-06 17:02:19 +00:00
+ value += ' ...';
label += `=${value}`;
}
2024-01-17 11:43:14 +00:00
return (0, theme_1.colorize)(this.config.theme?.flag, label);
2023-07-06 17:02:19 +00:00
diff --git a/node_modules/@oclif/core/lib/help/index.js b/node_modules/@oclif/core/lib/help/index.js
2024-03-11 13:19:15 +00:00
index 2aedfd3..f3d28a6 100644
2023-07-06 17:02:19 +00:00
--- a/node_modules/@oclif/core/lib/help/index.js
+++ b/node_modules/@oclif/core/lib/help/index.js
2024-03-11 13:19:15 +00:00
@@ -169,11 +169,12 @@ class Help extends HelpBase {
2023-07-06 17:02:19 +00:00
}
this.log(this.formatCommand(command));
this.log('');
- if (subTopics.length > 0) {
+ const SUPPRESS_SUBTOPICS = true;
+ if (subTopics.length > 0 && !SUPPRESS_SUBTOPICS) {
this.log(this.formatTopics(subTopics));
this.log('');
}
- if (subCommands.length > 0) {
2024-03-11 13:19:15 +00:00
+ if (subCommands.length > 0 && !SUPPRESS_SUBTOPICS) {
2023-07-06 17:02:19 +00:00
const aliases = [];
2023-10-05 10:52:10 +00:00
const uniqueSubCommands = subCommands.filter((p) => {
2023-07-06 17:02:19 +00:00
aliases.push(...p.aliases);
2023-09-06 14:39:31 +00:00
diff --git a/node_modules/@oclif/core/lib/parser/errors.js b/node_modules/@oclif/core/lib/parser/errors.js
2024-03-11 13:19:15 +00:00
index 656ec6b..cde9e38 100644
2023-09-06 14:39:31 +00:00
--- a/node_modules/@oclif/core/lib/parser/errors.js
+++ b/node_modules/@oclif/core/lib/parser/errors.js
2023-10-05 10:52:10 +00:00
@@ -14,7 +14,8 @@ Object.defineProperty(exports, "CLIError", { enumerable: true, get: function ()
2023-09-06 14:39:31 +00:00
class CLIParseError extends errors_1.CLIError {
2023-10-05 10:52:10 +00:00
parse;
2023-09-06 14:39:31 +00:00
constructor(options) {
- options.message += '\nSee more help with --help';
+ const help = options.command ? `\`${options.command} --help\`` : '--help';
+ options.message += `\nSee more help with ${help}`;
2023-12-08 13:30:08 +00:00
super(options.message, { exit: options.exit });
2023-09-06 14:39:31 +00:00
this.parse = options.parse;
}
2024-03-11 13:19:15 +00:00
@@ -37,7 +38,9 @@ exports.InvalidArgsSpecError = InvalidArgsSpecError;
2023-09-06 14:39:31 +00:00
class RequiredArgsError extends CLIParseError {
2023-10-05 10:52:10 +00:00
args;
2023-12-08 13:30:08 +00:00
constructor({ args, exit, flagsWithMultiple, parse, }) {
2023-09-06 14:39:31 +00:00
- let message = `Missing ${args.length} required arg${args.length === 1 ? '' : 's'}`;
+ const command = 'balena ' + parse.input.context.id.replace(/:/g, ' ');
+ let message = `Missing ${args.length} required argument${args.length === 1 ? '' : 's'}`;
2024-03-11 13:19:15 +00:00
+
2023-10-05 10:52:10 +00:00
const namedArgs = args.filter((a) => a.name);
2023-09-06 14:39:31 +00:00
if (namedArgs.length > 0) {
2023-10-05 10:52:10 +00:00
const list = (0, list_1.renderList)(namedArgs.map((a) => [a.name, a.description]));
2024-03-11 13:19:15 +00:00
@@ -48,8 +51,7 @@ class RequiredArgsError extends CLIParseError {
2023-09-06 14:39:31 +00:00
message += `\n\nNote: ${flags} allow${flagsWithMultiple.length === 1 ? 's' : ''} multiple values. Because of this you need to provide all arguments before providing ${flagsWithMultiple.length === 1 ? 'that flag' : 'those flags'}.`;
message += '\nAlternatively, you can use "--" to signify the end of the flags and the beginning of arguments.';
}
2023-12-08 13:30:08 +00:00
- super({ exit: cache_1.default.getInstance().get('exitCodes')?.requiredArgs ?? exit, message, parse });
2024-03-11 13:19:15 +00:00
- this.args = args;
+ super({ exit: cache_1.default.getInstance().get('exitCodes')?.requiredArgs ?? exit, message, parse, command }); this.args = args;
2023-09-06 14:39:31 +00:00
}
}
2024-03-11 13:19:15 +00:00
exports.RequiredArgsError = RequiredArgsError;