Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1486 from awoodbeck/bugfix/ensure-command-line-args
Browse files Browse the repository at this point in the history
Add optional '-v' flag to ensure args help text
  • Loading branch information
sdboyer authored Dec 28, 2017
2 parents 9d4a82e + 211dbce commit 59f7827
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BUG FIXES:
* Validate `git ls-remote` output and ignore all malformed lines (#1379)
* Support [gopkg.in version zero](http://labix.org/gopkg.in#VersionZero) (#1243).
* Fix how dep status print revision constraints. (#1421)
* Add optional `-v` flag to ensure sub command's syntax. (#1458)

IMPROVEMENTS:

Expand Down
2 changes: 1 addition & 1 deletion cmd/dep/ensure.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ var (

func (cmd *ensureCommand) Name() string { return "ensure" }
func (cmd *ensureCommand) Args() string {
return "[-update | -add] [-no-vendor | -vendor-only] [-dry-run] [<spec>...]"
return "[-update | -add] [-no-vendor | -vendor-only] [-dry-run] [-v] [<spec>...]"
}
func (cmd *ensureCommand) ShortHelp() string { return ensureShortHelp }
func (cmd *ensureCommand) LongHelp() string { return ensureLongHelp }
Expand Down
9 changes: 9 additions & 0 deletions cmd/dep/ensure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,15 @@ func TestValidateUpdateArgs(t *testing.T) {
},
lockedProjects: []string{"github.com/golang/dep"},
},
{
name: "flags after spec",
args: []string{"github.com/golang/dep@master", "-v"},
wantError: errUpdateArgsValidation,
wantWarn: []string{
"could not infer project root from dependency path",
},
lockedProjects: []string{"github.com/golang/dep"},
},
}

h := test.NewHelper(t)
Expand Down

0 comments on commit 59f7827

Please sign in to comment.