From 65410557dc1e00c2b39a1e4f18cee2ebbb017dad Mon Sep 17 00:00:00 2001 From: Shwetha Gururaj Date: Tue, 17 Dec 2024 10:24:34 -0500 Subject: [PATCH] Update help info related to revision command --- command/common/help_command.go | 2 -- command/common/internal/help_all_display.go | 11 +---------- command/common/internal/help_all_display_test.go | 10 ---------- command/v7/revisions_command.go | 2 +- command/v7/rollback_command.go | 2 +- integration/v7/isolated/revision_command_test.go | 2 +- integration/v7/isolated/revisions_command_test.go | 2 +- integration/v7/isolated/rollback_command_test.go | 2 +- 8 files changed, 6 insertions(+), 27 deletions(-) diff --git a/command/common/help_command.go b/command/common/help_command.go index 60aea1586d9..a7553bb8aa2 100644 --- a/command/common/help_command.go +++ b/command/common/help_command.go @@ -136,8 +136,6 @@ func (cmd HelpCommand) displayHelpFooter(cmdInfo map[string]sharedaction.Command cmd.UI.DisplayNonWrappingTable(sharedaction.AllCommandsIndent, cmd.globalOptionsTableData(), 25) cmd.UI.DisplayNewline() - - cmd.displayCommandGroups(internal.ExperimentalHelpCategoryList, cmdInfo, 34) } func (cmd HelpCommand) displayCommonCommands() { diff --git a/command/common/internal/help_all_display.go b/command/common/internal/help_all_display.go index b3a8ca198af..9de9243d3fc 100644 --- a/command/common/internal/help_all_display.go +++ b/command/common/internal/help_all_display.go @@ -17,7 +17,7 @@ var HelpCategoryList = []HelpCategory{ {"start", "stop", "restart", "stage-package", "restage", "restart-app-instance"}, {"run-task", "task", "tasks", "terminate-task"}, {"packages", "create-package"}, - {"revisions", "rollback"}, + {"revision", "revisions", "rollback"}, {"droplets", "set-droplet", "download-droplet"}, {"events", "logs"}, {"env", "set-env", "unset-env"}, @@ -168,12 +168,3 @@ var HelpCategoryList = []HelpCategory{ }, }, } - -var ExperimentalHelpCategoryList = []HelpCategory{ - { - CategoryName: "EXPERIMENTAL COMMANDS:", - CommandList: [][]string{ - {"revision"}, - }, - }, -} diff --git a/command/common/internal/help_all_display_test.go b/command/common/internal/help_all_display_test.go index bb93ffb9ce9..695b5690566 100644 --- a/command/common/internal/help_all_display_test.go +++ b/command/common/internal/help_all_display_test.go @@ -34,16 +34,6 @@ var _ = Describe("test help all display", func() { } } } - - for _, category := range internal.ExperimentalHelpCategoryList { - for _, row := range category.CommandList { - for _, command := range row { - if command != "" { - fromHelpAllDisplay = append(fromHelpAllDisplay, command) - } - } - } - } }) It("lists all commands from command list in at least one category", func() { diff --git a/command/v7/revisions_command.go b/command/v7/revisions_command.go index 2c309350b61..366d9a5c48d 100644 --- a/command/v7/revisions_command.go +++ b/command/v7/revisions_command.go @@ -21,7 +21,7 @@ type RevisionsCommand struct { usage interface{} `usage:"CF_NAME revisions APP_NAME"` BaseCommand - relatedCommands interface{} `related_commands:"rollback"` + relatedCommands interface{} `related_commands:"revision, rollback"` } func (cmd RevisionsCommand) Execute(_ []string) error { diff --git a/command/v7/rollback_command.go b/command/v7/rollback_command.go index 29c7c2e7169..477b75bdeea 100644 --- a/command/v7/rollback_command.go +++ b/command/v7/rollback_command.go @@ -20,7 +20,7 @@ type RollbackCommand struct { MaxInFlight *int `long:"max-in-flight" description:"Defines the maximum number of instances that will be actively being rolled back."` Strategy flag.DeploymentStrategy `long:"strategy" description:"Deployment strategy can be canary or rolling. When not specified, it defaults to rolling."` Version flag.Revision `long:"version" required:"true" description:"Roll back to the specified revision"` - relatedCommands interface{} `related_commands:"revisions"` + relatedCommands interface{} `related_commands:"revision, revisions"` usage interface{} `usage:"CF_NAME rollback APP_NAME [--version VERSION] [-f]"` LogCacheClient sharedaction.LogCacheClient diff --git a/integration/v7/isolated/revision_command_test.go b/integration/v7/isolated/revision_command_test.go index 9ccf1a49be3..923db9be2b7 100644 --- a/integration/v7/isolated/revision_command_test.go +++ b/integration/v7/isolated/revision_command_test.go @@ -34,7 +34,7 @@ var _ = Describe("revision command", func() { It("appears in cf help -a", func() { session := helpers.CF("help", "-a") Eventually(session).Should(Exit(0)) - Expect(session).To(HaveCommandInCategoryWithDescription("revision", "EXPERIMENTAL COMMANDS", "Show details for a specific app revision")) + Expect(session).To(HaveCommandInCategoryWithDescription("revision", "APPS", "Show details for a specific app revision")) }) It("Displays revision command usage to output", func() { diff --git a/integration/v7/isolated/revisions_command_test.go b/integration/v7/isolated/revisions_command_test.go index 952654b1b7a..bb718f0177c 100644 --- a/integration/v7/isolated/revisions_command_test.go +++ b/integration/v7/isolated/revisions_command_test.go @@ -43,7 +43,7 @@ var _ = Describe("revisions command", func() { Eventually(session).Should(Say("USAGE:")) Eventually(session).Should(Say("cf revisions APP_NAME")) Eventually(session).Should(Say("SEE ALSO:")) - Eventually(session).Should(Say("rollback")) + Eventually(session).Should(Say("revision, rollback")) Eventually(session).Should(Exit(0)) }) }) diff --git a/integration/v7/isolated/rollback_command_test.go b/integration/v7/isolated/rollback_command_test.go index e8c1b6c9431..e2bbc7b4f79 100644 --- a/integration/v7/isolated/rollback_command_test.go +++ b/integration/v7/isolated/rollback_command_test.go @@ -39,7 +39,7 @@ var _ = Describe("rollback command", func() { Expect(session).To(Say(`--strategy\s+Deployment strategy can be canary or rolling. When not specified, it defaults to rolling.`)) Expect(session).To(Say(`--version\s+Roll back to the specified revision`)) Expect(session).To(Say("SEE ALSO:")) - Expect(session).To(Say("revisions")) + Expect(session).To(Say("revision, revisions")) }) }) })