-
Notifications
You must be signed in to change notification settings - Fork 1.7k
V3: unknown flag parsing is broken from v2: flag provided but not defined #2072
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
Comments
@MrNaif2018 Thanks for the examples and the output. v3 has support for intermingling flags and positions arguments in any order, thats why you see the behaviour in first example in v3. The second example uses "--" and so all flag parsing stops there. Currently I'm rewriting the parser for v3. See #2074 . In general though "--" is the correct way to stop flag/arg parsing so if you can use that you should keep doing it. The SkipFlagParsing was added to overcome the deficiencies in the golang parser we have been using so far. I'm thinking of getting rid of that flag entirely. Let me know what you think. |
Yeah, I agree that There only concern I see is, sometimes it is required to use And in cobra lib they have two useful settings (one implemented, one not implemented): So that could help implement this workflow if user sets whitelist unknown flag + adds their custom parsing |
@MrNaif2018 Check #2074 |
If I install from this PR, it will resolve the issue of parsing flags right without |
Not really but you should see a consistent behavior when using "--". Use just "--" without SkipFlagParsing and see how far you can go. |
@MrNaif2018 Whats the behaviour you see with the latest code ? |
Hi! Using the latest released urfave/cli v3.0.0-beta1, I get a different behaviour from v2
V2:
V3:
I rely on unknown flags parsing to parse all by-name arguments to external JSONRPC server. There's SkipFlagParsing but it seems to disable all functionality in general
Is there some way to allow to parse unknown flags in Action still?
Attaching example code to test in V2 and V3
V2 code
V3 code
The text was updated successfully, but these errors were encountered: