We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've had several cases where I've made a typo when accessing a flag value via the context.
I'd like the library to panic if I access an undefined flag.
func main() { app := &cli.App{ Flags: []cli.Flag{ &cli.StringFlag{ Name: "foo", }, }, Action: func(c *cli.Context) error { // I want this to panic _ = c.String("bar") return nil }, } app.Run([]string{"test"}) }
The text was updated successfully, but these errors were encountered:
@icholy you may want to consider using the recently-added (by @toaster 🙇🏼) ability to get the value directly from a given flag
Sorry, something went wrong.
I'd much prefer to keep my existing code and just enable some type of "strict mode" flag.
@icholy This would be nice, are you willing to submit a PR ?
@dearchap if you want to, go for it. Edit see the linked pr.
Fixed. .
No branches or pull requests
Checklist
What problem does this solve?
I've had several cases where I've made a typo when accessing a flag value via the context.
Solution description
I'd like the library to panic if I access an undefined flag.
The text was updated successfully, but these errors were encountered: