Skip to content

Commit

Permalink
Merge pull request #208 from cloudfoundry/change-parameter-naming
Browse files Browse the repository at this point in the history
Change help parameter order
  • Loading branch information
Yavor16 authored Aug 30, 2024
2 parents 64ad147 + a31df37 commit 27b763a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 2 additions & 3 deletions commands/blue_green_deploy_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command {
cf deploy -i OPERATION_ID -a ACTION [-u URL]`,
Options: map[string]string{
extDescriptorsOpt: "Extension descriptors",
timeoutOpt: "Start apps timeout in seconds",
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
versionRuleOpt: "Version rule (HIGHER, SAME_HIGHER, ALL)",
operationIDOpt: "Active deploy operation ID",
Expand All @@ -57,10 +56,10 @@ func (c *BlueGreenDeployCommand) GetPluginCommand() plugin.Command {
util.GetShortOption(abortOnErrorOpt): "Auto-abort the process on any errors",
util.GetShortOption(retriesOpt): "Retry the operation N times in case a non-content error occurs (default 3)",
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",
util.GetShortOption(startTimeoutOpt): "Start app timeout in seconds",
util.GetShortOption(stageTimeoutOpt): "Stage app timeout in seconds",
util.GetShortOption(uploadTimeoutOpt): "Upload app timeout in seconds",
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
util.CombineFullAndShortParameters(startTimeoutOpt, timeoutOpt): "Start app timeout in seconds",
},
},
}
Expand Down
7 changes: 3 additions & 4 deletions commands/deploy_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command {
<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]`,
Options: map[string]string{
extDescriptorsOpt: "Extension descriptors",
timeoutOpt: "Start apps timeout in seconds",
deployServiceURLOpt: "Deploy service URL, by default 'deploy-service.<system-domain>'",
versionRuleOpt: "Version rule (HIGHER, SAME_HIGHER, ALL)",
operationIDOpt: "Active deploy operation ID",
Expand All @@ -133,10 +132,10 @@ func (c *DeployCommand) GetPluginCommand() plugin.Command {
util.GetShortOption(strategyOpt): "Specify the deployment strategy when updating an mta (default, blue-green)",
util.GetShortOption(skipTestingPhase): "(STRATEGY: BLUE-GREEN) Do not require confirmation for deleting the previously deployed MTA app",
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",
util.GetShortOption(startTimeoutOpt): "Start app timeout in seconds",
util.GetShortOption(stageTimeoutOpt): "Stage app timeout in seconds",
util.GetShortOption(uploadTimeoutOpt): "Upload app timeout in seconds",
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
util.GetShortOption(taskExecutionTimeoutOpt): "Task execution timeout in seconds",
util.CombineFullAndShortParameters(startTimeoutOpt, timeoutOpt): "Start app timeout in seconds",
},
},
}
Expand Down Expand Up @@ -224,7 +223,7 @@ func (c *DeployCommand) executeInternal(positionalArgs []string, dsHost string,

mtaElementsCalculator := createMtaElementsCalculator(flags)

rawMtaArchive, err := c.getMtaArchive(positionalArgs, mtaElementsCalculator)
rawMtaArchive, err := c.getMtaArchive(positionalArgs, mtaElementsCalculator)
if err != nil {
ui.Failed("Error retrieving MTA: %s", err.Error())
return Failure
Expand Down
4 changes: 4 additions & 0 deletions util/cf_command_options_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import (
"strings"
)

func CombineFullAndShortParameters(fullParameter string, shortParameter string) string {
return GetShortOption(fullParameter) + ", -" + shortParameter
}

//GetShortOption ...
func GetShortOption(option string) string {
var opt bytes.Buffer
Expand Down

0 comments on commit 27b763a

Please sign in to comment.