-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Cannot set flagset to ExitOnError for command #1633
Comments
Maybe related to #582, #922, #1305, which is something we are having trouble fixing due to backwards-compatibility concerns. @tasherif-msft can you provide a small example to reproduce the problem to better understand if this is the same or a different issue? |
Hi @marckhouzam, yes it appears that this is a known issue then - I'm wondering is it not possible to create a new method that would accept this enum as a parameter when initializing the flatset? |
Hi @marckhouzam Here is a minimal repro https://go.dev/play/p/Ge_P9YLn_gO If you run this command from the command line locally and run |
Hi @marckhouzam and @jpmcb, I've created a draft PR of a possible solution to this problem. Could you take a look and see if it looks feasible? Then I can add some tests and open the PR. |
The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:
|
When creating a new command I'm unable to set the Flagset to
ExitOnError
The setting to
ContinueOnError
causes cases where the return error code is 0 even though something has went wrong.For example:
The text was updated successfully, but these errors were encountered: