GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
In 1.20.0 this used to work
myCLI myCommand --someArg someInput docker run --rm ubuntu bash
In 1.21.0 it's broken, with this error message
Incorrect Usage: flag provided but not defined: -rm
The issue here is that the CLI is reading --rm as input to myCommand, rather than input to docker run.
Pass through commands in general are (...) a bit difficult to support. The hotfix here is to invoke docker like this
- myCLI myCommand --someArg someInput docker run --rm ubuntu bash
+ myCLI myCommand --someArg someInput -- docker run --rm ubuntu bash
Tangentially, when you hit this bug it exits with code 0, which can very easily "gotcha!" you if you're expecting a given command to failed on errors.
EDIT: this is probably a different bug report, though.
Ah, the lack of an error response was because my specific CLI wasn't checking for an error from app.Run. I think a previous version of the readme suggested not checking for app.Run errors.
I'm going to start looking into this next week 📆
If anyone drops into this issue and definitely knows how to fix the problem, feel free to take this off my hands ^_^ You'll have to race me for the PR though 🏃♀
Beware before merging: there's an issue in urfave/cli 1.21.0: urfave/cli#850
Just ran a bisect, and it looks like this is the commit that caused the bug df562bf
Which was merged in this PR #691