mirror of https://github.com/docker/cli.git
cmd/docker: only parse global arguments once.
Before calling `cmd.Execute` we need to reset the arguments to be used to not include the global arguments which we have already parsed. This is precisely the `args` which we have in our hand at this point. This fixes `TestGlobalArgsOnlyParsedOnce/builtin` in the cli-plugins e2e tests. `TestGlobalArgsOnlyParsedOnce/plugin` is still broken will be fixed next. Signed-off-by: Ian Campbell <ijc@docker.com>
This commit is contained in:
parent
d32f3647b1
commit
8c087b6a1e
|
@ -228,6 +228,9 @@ func runDocker(dockerCli *command.DockerCli) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We've parsed global args already, so reset args to those
|
||||||
|
// which remain.
|
||||||
|
cmd.SetArgs(args)
|
||||||
return cmd.Execute()
|
return cmd.Execute()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue