mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-29 15:44:26 +00:00
cdf807993d
Change-type: patch
99 lines
5.2 KiB
Diff
99 lines
5.2 KiB
Diff
diff --git a/node_modules/@oclif/core/lib/cli-ux/list.js b/node_modules/@oclif/core/lib/cli-ux/list.js
|
|
index 607d8dc..07ba1f2 100644
|
|
--- 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');
|
|
}
|
|
diff --git a/node_modules/@oclif/core/lib/help/command.js b/node_modules/@oclif/core/lib/help/command.js
|
|
index bc54de4..cb246ce 100644
|
|
--- a/node_modules/@oclif/core/lib/help/command.js
|
|
+++ b/node_modules/@oclif/core/lib/help/command.js
|
|
@@ -59,7 +59,9 @@ class CommandHelp extends formatter_1.HelpFormatter {
|
|
return;
|
|
return args.map((a) => {
|
|
// 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}]`;
|
|
+
|
|
let description = a.description || '';
|
|
if (a.default)
|
|
description = `${(0, theme_1.colorize)(this.config?.theme?.flagDefaultValue, `[default: ${a.default}]`)} ${description}`;
|
|
@@ -154,14 +156,12 @@ class CommandHelp extends formatter_1.HelpFormatter {
|
|
label = labels.join(flag.char ? (0, theme_1.colorize)(this.config?.theme?.flagSeparator, ', ') : ' ');
|
|
}
|
|
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('|'))
|
|
- value = chalk_1.default.underline(value);
|
|
+ value += ' ...';
|
|
label += `=${value}`;
|
|
}
|
|
return (0, theme_1.colorize)(this.config.theme?.flag, label);
|
|
diff --git a/node_modules/@oclif/core/lib/help/index.js b/node_modules/@oclif/core/lib/help/index.js
|
|
index e1859e1..756654c 100644
|
|
--- a/node_modules/@oclif/core/lib/help/index.js
|
|
+++ b/node_modules/@oclif/core/lib/help/index.js
|
|
@@ -172,11 +172,12 @@ class Help extends HelpBase {
|
|
}
|
|
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) {
|
|
+ if (subCommands.length > 0 && !SUPPRESS_SUBTOPICS) {
|
|
const aliases = [];
|
|
const uniqueSubCommands = subCommands.filter((p) => {
|
|
aliases.push(...p.aliases);
|
|
diff --git a/node_modules/@oclif/core/lib/parser/errors.js b/node_modules/@oclif/core/lib/parser/errors.js
|
|
index b37743a..489d66e 100644
|
|
--- a/node_modules/@oclif/core/lib/parser/errors.js
|
|
+++ b/node_modules/@oclif/core/lib/parser/errors.js
|
|
@@ -15,7 +15,8 @@ class CLIParseError extends errors_1.CLIError {
|
|
parse;
|
|
showHelp = false;
|
|
constructor(options) {
|
|
- options.message += '\nSee more help with --help';
|
|
+ const help = options.command ? `\`${options.command} --help\`` : '--help';
|
|
+ options.message += `\nSee more help with ${help}`;
|
|
super(options.message, { exit: options.exit });
|
|
this.parse = options.parse;
|
|
}
|
|
@@ -38,7 +39,9 @@ exports.InvalidArgsSpecError = InvalidArgsSpecError;
|
|
class RequiredArgsError extends CLIParseError {
|
|
args;
|
|
constructor({ args, exit, flagsWithMultiple, parse, }) {
|
|
- 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'}`;
|
|
+
|
|
const namedArgs = args.filter((a) => a.name);
|
|
if (namedArgs.length > 0) {
|
|
const list = (0, list_1.renderList)(namedArgs.map((a) => {
|
|
@@ -52,7 +55,7 @@ class RequiredArgsError extends CLIParseError {
|
|
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.';
|
|
}
|
|
- super({ exit: cache_1.default.getInstance().get('exitCodes')?.requiredArgs ?? exit, message, parse });
|
|
+ super({ exit: cache_1.default.getInstance().get('exitCodes')?.requiredArgs ?? exit, message, parse, command });
|
|
this.args = args;
|
|
this.showHelp = true;
|
|
}
|