Skip to content

Change help parameter order #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading