We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2de186c commit c49071dCopy full SHA for c49071d
commands.go
@@ -177,7 +177,11 @@ func (c *Commands) parse(
177
args = args[1:]
178
cmds = append(cmds, cmd)
179
cur = &cmd.commands
180
-
+ // 使用--进行分隔。解决参数值可能与子命令字面量一致的问题
181
+ var bDoubleBar = false
182
+ if len(args) > 0 && args[0] == "--" {
183
+ bDoubleBar = true
184
+ }
185
// Parse the command flags.
186
fg := make(FlagMap)
187
args, err = cmd.flags.parse(args, fg)
@@ -188,6 +192,11 @@ func (c *Commands) parse(
188
192
if !skipFlagMaps {
189
193
fgs = append(fgs, fg)
190
194
}
195
+
196
197
+ if len(args) > 0 && bDoubleBar {
198
+ break
199
191
200
201
202
0 commit comments