New issue
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? Sign in to your account
"gomplate -in flibbit" should produce an error #192
Comments
Thanks for reporting this, @docwhat! I agree - that's a bit odd. This used to be the case, but I think additional args are silently ignored ever since I moved to using |
When I was using kingpin I had a similar problem; I was not checking all the error conditions. |
Reading the docs on arguments, I think what you want is a line in the ...
Args: NoArgs,
... But I'm not sure, since I'm just speed reading the docs and change history of cobra. |
P.S. For macOS users Homebrew/homebrew-core#15811 |
thanks @docwhat - I already have a tap at https://github.com/hairyhenderson/homebrew-tap, but being in core would be cool! |
@hairyhenderson this looks to have a quick fix so I submitted PR #208 that registers cobra.NoArgs for the rootCmd as mentioned by @docwhat earlier #192 (comment) |
I would expect that non-flag arguments would raise an error in
gomplate
.Expected:
Actual:
I got bit by this because I typed
-in
instead of--in
and spent a while trying to figure out what I did wrong.FYI:
-in
can be rewritten as--in 'n'
The text was updated successfully, but these errors were encountered: