2020-04-30 06:52:19 +00:00
|
|
|
diff --git a/node_modules/@oclif/parser/lib/errors.js b/node_modules/@oclif/parser/lib/errors.js
|
2023-05-02 15:46:32 +00:00
|
|
|
index 39936e3..23e3925 100644
|
2020-04-30 06:52:19 +00:00
|
|
|
--- a/node_modules/@oclif/parser/lib/errors.js
|
|
|
|
+++ b/node_modules/@oclif/parser/lib/errors.js
|
2023-05-02 15:46:32 +00:00
|
|
|
@@ -14,7 +14,8 @@ const m = deps_1.default()
|
2020-04-30 06:52:19 +00:00
|
|
|
.add('list', () => require('./list'));
|
|
|
|
class CLIParseError extends errors_1.CLIError {
|
|
|
|
constructor(options) {
|
|
|
|
- options.message += '\nSee more help with --help';
|
2023-05-02 15:46:32 +00:00
|
|
|
+ const help = options.command ? `\`${options.command} --help\`` : '--help';
|
|
|
|
+ options.message += `\nSee more help with ${help}`;
|
2020-04-30 06:52:19 +00:00
|
|
|
super(options.message);
|
|
|
|
this.parse = options.parse;
|
|
|
|
}
|
2023-05-02 15:46:32 +00:00
|
|
|
@@ -35,22 +36,24 @@ class InvalidArgsSpecError extends CLIParseError {
|
2020-04-30 06:52:19 +00:00
|
|
|
exports.InvalidArgsSpecError = InvalidArgsSpecError;
|
|
|
|
class RequiredArgsError extends CLIParseError {
|
|
|
|
constructor({ args, parse }) {
|
|
|
|
- let message = `Missing ${args.length} required arg${args.length === 1 ? '' : 's'}`;
|
2023-05-02 15:46:32 +00:00
|
|
|
+ const command = 'balena ' + parse.input.context.id.replace(/:/g, ' ');
|
|
|
|
+ let message = `Missing ${args.length} required argument${args.length === 1 ? '' : 's'}`;
|
2020-04-30 06:52:19 +00:00
|
|
|
const namedArgs = args.filter(a => a.name);
|
2020-08-13 07:56:32 +00:00
|
|
|
if (namedArgs.length > 0) {
|
2020-04-30 06:52:19 +00:00
|
|
|
const list = m.list.renderList(namedArgs.map(a => [a.name, a.description]));
|
|
|
|
message += `:\n${list}`;
|
|
|
|
}
|
|
|
|
- super({ parse, message });
|
|
|
|
+ super({ parse, message, command });
|
|
|
|
this.args = args;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exports.RequiredArgsError = RequiredArgsError;
|
|
|
|
class RequiredFlagError extends CLIParseError {
|
|
|
|
constructor({ flag, parse }) {
|
2023-05-02 15:46:32 +00:00
|
|
|
+ const command = 'balena ' + parse.input.context.id.replace(/:/g, ' ');
|
2020-04-30 06:52:19 +00:00
|
|
|
const usage = m.list.renderList(m.help.flagUsages([flag], { displayRequired: false }));
|
|
|
|
const message = `Missing required flag:\n${usage}`;
|
|
|
|
- super({ parse, message });
|
|
|
|
+ super({ parse, message, command });
|
|
|
|
this.flag = flag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
diff --git a/node_modules/@oclif/parser/lib/list.js b/node_modules/@oclif/parser/lib/list.js
|
2023-05-02 15:46:32 +00:00
|
|
|
index 9d020b7..6ea9eb9 100644
|
2020-04-30 06:52:19 +00:00
|
|
|
--- a/node_modules/@oclif/parser/lib/list.js
|
|
|
|
+++ b/node_modules/@oclif/parser/lib/list.js
|
2023-05-02 15:46:32 +00:00
|
|
|
@@ -22,7 +22,7 @@ function renderList(items) {
|
2020-04-30 06:52:19 +00:00
|
|
|
}
|
|
|
|
left = left.padEnd(maxLength);
|
|
|
|
right = linewrap(maxLength + 2, right);
|
|
|
|
- return `${left} ${right}`;
|
2023-05-02 15:46:32 +00:00
|
|
|
+ return `${left} : ${right}`;
|
2020-04-30 06:52:19 +00:00
|
|
|
});
|
|
|
|
return lines.join('\n');
|
|
|
|
}
|