From c439c4fa093711d42e1b01acb1235b52004753c1 Mon Sep 17 00:00:00 2001 From: Di Xu Date: Mon, 19 Mar 2018 14:20:04 +0800 Subject: [PATCH] Terminate the stripping of flags when -- is found (#649) --- command.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/command.go b/command.go index 29675b33..15b81127 100644 --- a/command.go +++ b/command.go @@ -475,6 +475,9 @@ Loop: s := args[0] args = args[1:] switch { + case s == "--": + // "--" terminates the flags + break Loop case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags): // If '--flag arg' then // delete arg from args.