Skip to content

Commit

Permalink
Revert "cf login: complain when we encounter extraneous arguments"
Browse files Browse the repository at this point in the history
This reverts commit 3b52431.

[#167948703](https://www.pivotaltracker.com/story/show/167948703)

Co-authored-by: Brendan Smith <brsmith@pivotal.io>
  • Loading branch information
acrmp and bwasmith committed Aug 23, 2019
1 parent 3677bc1 commit 4934877
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
13 changes: 2 additions & 11 deletions integration/shared/isolated/login_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,10 @@ var _ = Describe("login command", func() {
Describe("Invalid Command Usage", func() {
When("a random flag is passed in", func() {
It("should exit 1 and display an unknown flag error message", func() {
session := helpers.CF("login", "--i-am-an-unknown-flag")
session := helpers.CF("login", "--test")
Eventually(session).Should(Exit(1))

Expect(session.Err).Should(Say("Incorrect Usage: unknown flag `i-am-an-unknown-flag'"))
})
})

When("an extra argument is passed in", func() {
It("should exit 1 and display an unexpected argument error message", func() {
session := helpers.CF("login", "-a", "api.missing-fish.lite.cli.fun", "--skip-ssl-validation", "i-am-an-extra-argument")
Eventually(session).Should(Exit(1))

Expect(session.Err).Should(Say(`Incorrect Usage: unexpected argument "i-am-an-extra-argument"`))
Expect(session.Err).Should(Say("Incorrect Usage: unknown flag `test'"))
})
})
})
Expand Down
10 changes: 0 additions & 10 deletions prevent_extra_args_v6.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

package main

import (
"code.cloudfoundry.org/cli/command/translatableerror"
"strings"
)

func preventExtraArgs(args []string) error {
if len(args) > 0 {
return translatableerror.TooManyArgumentsError{
ExtraArgument: strings.Join(args, " "),
}
}
return nil
}

0 comments on commit 4934877

Please sign in to comment.