Merge pull request #2001 from balena-io/fix-template-patch

Fix help template bug affecting discrete value options
This commit is contained in:
bulldozer-balena[bot] 2020-08-21 11:26:26 +00:00 committed by GitHub
commit edb3ea53fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 24 deletions

View File

@ -970,15 +970,15 @@ do not prompt for confirmation before deleting the variable
## env add NAME [VALUE]
Add an environment or config variable to one or more applications, devices
or services, as selected by the respective command-line options. Either the
--application or the --device option must be provided, and either may be be
used alongside the --service option to define a service-specific variable.
(A service is an application container in a "microservices" application.)
When the --service option is used in conjunction with the --device option,
the service variable applies to the selected device only. Otherwise, it
applies to all devices of the selected application (i.e., the application's
fleet). If the --service option is omitted, the variable applies to all
Add an environment or config variable to one or more applications, devices
or services, as selected by the respective command-line options. Either the
--application or the --device option must be provided, and either may be be
used alongside the --service option to define a service-specific variable.
(A service is an application container in a "microservices" application.)
When the --service option is used in conjunction with the --device option,
the service variable applies to the selected device only. Otherwise, it
applies to all devices of the selected application (i.e., the application's
fleet). If the --service option is omitted, the variable applies to all
services.
If VALUE is omitted, the CLI will attempt to use the value of the environment

View File

@ -39,17 +39,17 @@ interface ArgsDef {
export default class EnvAddCmd extends Command {
public static description = stripIndent`
Add an environment or config variable to one or more applications, devices or services.
Add env or config variable to application(s), device(s) or service(s).
Add an environment or config variable to one or more applications, devices
or services, as selected by the respective command-line options. Either the
--application or the --device option must be provided, and either may be be
used alongside the --service option to define a service-specific variable.
(A service is an application container in a "microservices" application.)
When the --service option is used in conjunction with the --device option,
the service variable applies to the selected device only. Otherwise, it
applies to all devices of the selected application (i.e., the application's
fleet). If the --service option is omitted, the variable applies to all
Add an environment or config variable to one or more applications, devices
or services, as selected by the respective command-line options. Either the
--application or the --device option must be provided, and either may be be
used alongside the --service option to define a service-specific variable.
(A service is an application container in a "microservices" application.)
When the --service option is used in conjunction with the --device option,
the service variable applies to the selected device only. Otherwise, it
applies to all devices of the selected application (i.e., the application's
fleet). If the --service option is omitted, the variable applies to all
services.
If VALUE is omitted, the CLI will attempt to use the value of the environment

View File

@ -1,5 +1,5 @@
diff --git a/node_modules/@oclif/plugin-help/lib/command.js b/node_modules/@oclif/plugin-help/lib/command.js
index 1caa65b..b84a5b5 100644
index 1caa65b..e205faf 100644
--- a/node_modules/@oclif/plugin-help/lib/command.js
+++ b/node_modules/@oclif/plugin-help/lib/command.js
@@ -87,7 +87,7 @@ class CommandHelp {
@ -11,13 +11,14 @@ index 1caa65b..b84a5b5 100644
let description = a.description || '';
if (a.default)
description = `[default: ${a.default}] ${description}`;
@@ -131,8 +131,7 @@ class CommandHelp {
@@ -130,9 +130,7 @@ class CommandHelp {
if (!flag.helpValue && flag.options) {
value = flag.options.join('|');
}
if (!value.includes('|'))
- if (!value.includes('|'))
- value = underline(value);
- left += `=${value}`;
+ left += ` <${value}>`;
+ left += ` <${value}>`;
}
let right = flag.description || '';
if (flag.type === 'option' && flag.default) {

View File

@ -67,7 +67,7 @@ Additional commands:
device rm <uuid(s)> remove one or more devices
device shutdown <uuid> shutdown a device
devices supported list the supported device types (like 'raspberrypi3' or 'intel-nuc')
env add <name> [value] add an environment or config variable to one or more applications, devices or services
env add <name> [value] add env or config variable to application(s), device(s) or service(s)
env rename <id> <value> change the value of a config or env var for an app, device or service
env rm <id> remove a config or env var from an application, device or service
envs list the environment or config variables of an application, device or service