main: do not process -v or --version after a '--'

This commit is contained in:
Ryan Uber 2015-03-11 16:33:55 -07:00
parent 66d89ab4df
commit 9aba3c42c5
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,9 @@ func realMain() int {
// just show the version. // just show the version.
args := os.Args[1:] args := os.Args[1:]
for _, arg := range args { for _, arg := range args {
if arg == "--" {
break
}
if arg == "-v" || arg == "--version" { if arg == "-v" || arg == "--version" {
newArgs := make([]string, len(args)+1) newArgs := make([]string, len(args)+1)
newArgs[0] = "version" newArgs[0] = "version"