main: do not process -v or --version after a '--'
This commit is contained in:
parent
66d89ab4df
commit
9aba3c42c5
3
main.go
3
main.go
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue