agent
agent copied to clipboard
Argparse bug when using quoted values
When trying to enable shallow git clones and fetches via arguments if you specify the flags via spaces as the help usage suggests, e.g.
buildkite-agent start --git-clone-flags "-v --depth=1" --git-fetch-flags "-v --depth=1"
an error is thrown:
flag provided but not defined: -v --depth
however if you use key=value, the flags are accepted
buildkite-agent start --git-clone-flags="-v --depth=1" --git-fetch-flags="-v --depth=1"
Thanks for the report @brandonhoughton 🤔
Presumably a bug in github.com/urfave/cli v1, or maybe in how we pass those args through to git etc.
We can't jump on this right away, but we do have it tracked to look at when time permits.
I believe this was fixed in https://github.com/buildkite/agent/pull/1619, and we did not even notice! The latest version of the agent does support parsing flags with =
in them. I've tested it with version v3.43.1 and the agent started with --git-clone-flags "-v --depth=1" --git-fetch-flags "-v --depth=1"
set. I could see the fetch flag propagated to the build as well. Let us know if you still have problems with it.