Skip to content

Commit

Permalink
Fix invalid usage of create-space
Browse files Browse the repository at this point in the history
Before Fix: If cf user does
'cf create-space my-space blahablaha'
then its success

After Fix:If cf user does
'cf create-space my-space blahablaha'
then it will fail with proper reason
  • Loading branch information
liuhewei committed Nov 4, 2014
1 parent 1da9ca1 commit 3425607
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cf/commands/space/create_space.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (cmd CreateSpace) Metadata() command_metadata.CommandMetadata {
}

func (cmd CreateSpace) GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requirements.Requirement, err error) {
if len(c.Args()) == 0 {
if len(c.Args()) != 1 {
cmd.ui.FailWithUsage(c)
}

Expand Down
2 changes: 1 addition & 1 deletion cf/commands/space/create_space_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var _ = Describe("create-space command", func() {
})

Describe("Requirements", func() {
It("fails with usage when no arguments are passed", func() {
It("fails with usage when not provided exactly one argument", func() {
runCommand()
Expect(ui.FailedWithUsage).To(BeTrue())
})
Expand Down

0 comments on commit 3425607

Please sign in to comment.