-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
area/v2relates to / is being considered for v2relates to / is being considered for v2kind/featuredescribes a code enhancement / feature requestdescribes a code enhancement / feature request
Description
Checklist
- Are you running the latest v2 release? The list of releases is here.
- Did you check the manual for your release? The v2 manual is here.
- Did you perform a search about this feature? Here's the Github guide about searching.
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.
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"})
}
Metadata
Metadata
Assignees
Labels
area/v2relates to / is being considered for v2relates to / is being considered for v2kind/featuredescribes a code enhancement / feature requestdescribes a code enhancement / feature request