Skip to content

Commit

Permalink
Merge branch 'v7'
Browse files Browse the repository at this point in the history
[#174503944](https://www.pivotaltracker.com/story/show/174503944)

Co-authored-by: Nick Webb <[email protected]>
Signed-off-by: Nick Webb <[email protected]>
Co-authored-by: Nick Webb <[email protected]>
  • Loading branch information
a-b and nickjameswebb committed Oct 29, 2020
2 parents d2e65b3 + 32ccdfe commit 0eb80d0
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
1 change: 1 addition & 0 deletions command/common/command_list_v7.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ type commandList struct {
ResetOrgDefaultIsolationSegment v7.ResetOrgDefaultIsolationSegmentCommand `command:"reset-org-default-isolation-segment" description:"Reset the default isolation segment used for apps in spaces of an org"`
ResetSpaceIsolationSegment v7.ResetSpaceIsolationSegmentCommand `command:"reset-space-isolation-segment" description:"Reset the space's isolation segment to the org default"`
Restage v7.RestageCommand `command:"restage" alias:"rg" description:"Stage the app's latest package into a droplet and restart the app with this new droplet and updated configuration (environment variables, service bindings, buildpack, stack, etc.)."`
Revision v7.RevisionCommand `command:"revision" description:"Show details for a specific app revision"`
Revisions v7.RevisionsCommand `command:"revisions" description:"List revisions of an app"`
Rollback v7.RollbackCommand `command:"rollback" description:"Rollback to the specified revision of an app"`
StagePackage v7.StagePackageCommand `command:"stage-package" alias:"stage" description:"Stage a package into a droplet"`
Expand Down
2 changes: 1 addition & 1 deletion command/common/internal/help_all_display.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var HelpCategoryList = []HelpCategory{
{
CategoryName: "APPS:",
CommandList: [][]string{
{"apps", "app", "create-app", "revisions"},
{"apps", "app", "create-app", "revisions", "revision"},
{"push", "scale", "delete", "rename"},
{"cancel-deployment"},
{"start", "stop", "restart", "stage-package", "restage", "restart-app-instance"},
Expand Down
17 changes: 17 additions & 0 deletions command/v7/revision_command.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package v7

import (
"code.cloudfoundry.org/cli/command/flag"
)

type RevisionCommand struct {
BaseCommand
usage interface{} `usage:"CF_NAME revision APP_NAME [--version VERSION]"`
RequiredArgs flag.AppName `positional-args:"yes"`
Version flag.Revision `long:"version" required:"true" description:"The integer representing the specific revision to show"`
relatedCommands interface{} `related_commands:"revisions, rollback"`
}

func (cmd RevisionCommand) Execute(_ []string) error {
return nil
}
8 changes: 8 additions & 0 deletions command/v7/revision_command_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package v7_test

import (
. "github.com/onsi/ginkgo"
)

var _ = Describe("revision Command", func() {
})
37 changes: 37 additions & 0 deletions integration/v7/isolated/revision_command_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package isolated

import (
. "code.cloudfoundry.org/cli/cf/util/testhelpers/matchers"
"code.cloudfoundry.org/cli/integration/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
. "github.com/onsi/gomega/gexec"
)

var _ = Describe("revision command", func() {
Describe("help", func() {
When("--help flag is set", func() {
It("appears in cf help -a", func() {
session := helpers.CF("help", "-a")
Eventually(session).Should(Exit(0))
Expect(session).To(HaveCommandInCategoryWithDescription("revision", "APPS", "Show details for a specific app revision"))
})

It("Displays revision command usage to output", func() {
session := helpers.CF("revision", "--help")

Eventually(session).Should(Exit(0))

Expect(session).To(Say("NAME:"))
Expect(session).To(Say("revision - Show details for a specific app revision"))
Expect(session).To(Say("USAGE:"))
Expect(session).To(Say(`cf revision APP_NAME [--version VERSION]`))
Expect(session).To(Say("OPTIONS:"))
Expect(session).To(Say("--version The integer representing the specific revision to show"))
Expect(session).To(Say("SEE ALSO:"))
Expect(session).To(Say("revisions, rollback"))
})
})
})
})

0 comments on commit 0eb80d0

Please sign in to comment.