Skip to content

Commit a31df37

Browse files
author
Yavor16
committed
Change help parameter order
1 parent 64ad147 commit a31df37

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

commands/blue_green_deploy_command.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command {
3939
cf deploy -i OPERATION_ID -a ACTION [-u URL]`,
4040
Options: map[string]string{
4141
extDescriptorsOpt: "Extension descriptors",
42-
timeoutOpt: "Start apps timeout in seconds",
4342
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
4443
versionRuleOpt: "Version rule (HIGHER, SAME_HIGHER, ALL)",
4544
operationIDOpt: "Active deploy operation ID",
@@ -57,10 +56,10 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command {
5756
util.GetShortOption(abortOnErrorOpt): "Auto-abort the process on any errors",
5857
util.GetShortOption(retriesOpt): "Retry the operation N times in case a non-content error occurs (default 3)",
5958
util.GetShortOption(skipIdleStart): "Directly start the new MTA version as 'live', skipping the 'idle' phase of the resources. Do not require further confirmation or testing before deleting the old version",
60-
util.GetShortOption(startTimeoutOpt): "Start app timeout in seconds",
6159
util.GetShortOption(stageTimeoutOpt): "Stage app timeout in seconds",
6260
util.GetShortOption(uploadTimeoutOpt): "Upload app timeout in seconds",
63-
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
61+
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
62+
util.CombineFullAndShortParameters(startTimeoutOpt, timeoutOpt): "Start app timeout in seconds",
6463
},
6564
},
6665
}

commands/deploy_command.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command {
107107
<write MTA archive URL to STDOUT> | cf deploy [-e EXT_DESCRIPTOR[,...]] [-t TIMEOUT] [--version-rule VERSION_RULE] [-u MTA_CONTROLLER_URL] [--retries RETRIES] [--no-start] [--namespace NAMESPACE] [--delete-services] [--delete-service-keys] [--delete-service-brokers] [--keep-files] [--no-restart-subscribed-apps] [--do-not-fail-on-missing-permissions] [--abort-on-error] [--strategy STRATEGY] [--skip-testing-phase] [--skip-idle-start] [--apps-start-timeout TIMEOUT] [--apps-stage-timeout TIMEOUT] [--apps-upload-timeout TIMEOUT] [--apps-task-execution-timeout TIMEOUT]`,
108108
Options: map[string]string{
109109
extDescriptorsOpt: "Extension descriptors",
110-
timeoutOpt: "Start apps timeout in seconds",
111110
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
112111
versionRuleOpt: "Version rule (HIGHER, SAME_HIGHER, ALL)",
113112
operationIDOpt: "Active deploy operation ID",
@@ -133,10 +132,10 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command {
133132
util.GetShortOption(strategyOpt): "Specify the deployment strategy when updating an mta (default, blue-green)",
134133
util.GetShortOption(skipTestingPhase): "(STRATEGY: BLUE-GREEN) Do not require confirmation for deleting the previously deployed MTA app",
135134
util.GetShortOption(skipIdleStart): "(STRATEGY: BLUE-GREEN) Directly start the new MTA version as 'live', skipping the 'idle' phase of the resources. Do not require further confirmation or testing before deleting the old version",
136-
util.GetShortOption(startTimeoutOpt): "Start app timeout in seconds",
137135
util.GetShortOption(stageTimeoutOpt): "Stage app timeout in seconds",
138136
util.GetShortOption(uploadTimeoutOpt): "Upload app timeout in seconds",
139-
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
137+
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
138+
util.CombineFullAndShortParameters(startTimeoutOpt, timeoutOpt): "Start app timeout in seconds",
140139
},
141140
},
142141
}
@@ -224,7 +223,7 @@ func (c *DeployCommand) executeInternal(positionalArgs []string, dsHost string,
224223

225224
mtaElementsCalculator := createMtaElementsCalculator(flags)
226225

227-
rawMtaArchive, err := c.getMtaArchive(positionalArgs, mtaElementsCalculator)
226+
rawMtaArchive, err := c.getMtaArchive(positionalArgs, mtaElementsCalculator)
228227
if err != nil {
229228
ui.Failed("Error retrieving MTA: %s", err.Error())
230229
return Failure

util/cf_command_options_util.go

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import (
55
"strings"
66
)
77

8+
func CombineFullAndShortParameters(fullParameter string, shortParameter string) string {
9+
return GetShortOption(fullParameter) + ", -" + shortParameter
10+
}
11+
812
//GetShortOption ...
913
func GetShortOption(option string) string {
1014
var opt bytes.Buffer

0 commit comments

Comments
 (0)