-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Why design global options need to be before subcommands? #1391
Comments
I have to say, I find this extremely annoying as well. We use urfave/cli in go-ethereum, and are kind of stuck with it because we have so much code relying on it. It would be nice to be able to tweak this behavior using e.g.
and the implementation of it would be straightforward, just construct the flag set a bit differently. |
Funny, just stumbled upon this UX issue today as well. Was expecting Cobra does this with local vs persistent flags: https://github.com/spf13/cobra/blob/master/user_guide.md#persistent-flags Likely related:
I've also found that the help text seems to be fairly contrived with 3 different ways of triggering them and all with slightly different text when in my opinon they should all be the same.. Group 1
Group 2
Group 3
|
Yeah, as @tonglil said. It would be nice to show |
any update? |
While this is a nice feature to have it is non trivial as it means that the entire flag parse needs to change. This has been discussed endlessly in the past. If you can provide a PR we can gladly comment and incorporate |
Duplicate of #1113 |
- Move '--config' flag from global options to 'web' subcommand. - Set default '--config' flag value to 'fyj.ini'. [cli](github.com/urfave/cli) library requires global flags before subcommands/arguments. For refer to urfave/cli#1113, urfave/cli#1268 and urfave/cli#1391.
Global options need to appear before subcommands, not anywhere, why are they designed this way?
This is not the same as spf13/cobra.
In urfave/cli, global options are not visible in subcommands
.I like cobra's global options, but urfave/cli is simpler, that's why I use urfave/cli. Hope someone can explain my doubts...
The text was updated successfully, but these errors were encountered: