diff --git a/CHANGELOG.md b/CHANGELOG.md index f927a3f048..fe3efaf7fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/cmd/dep/ensure.go b/cmd/dep/ensure.go index 7d14778368..3b0b1041ee 100644 --- a/cmd/dep/ensure.go +++ b/cmd/dep/ensure.go @@ -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] [...]" + return "[-update | -add] [-no-vendor | -vendor-only] [-dry-run] [-v] [...]" } func (cmd *ensureCommand) ShortHelp() string { return ensureShortHelp } func (cmd *ensureCommand) LongHelp() string { return ensureLongHelp } diff --git a/cmd/dep/ensure_test.go b/cmd/dep/ensure_test.go index 2ff439a6dc..15d16fd9b5 100644 --- a/cmd/dep/ensure_test.go +++ b/cmd/dep/ensure_test.go @@ -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)