You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var args struct {
Foo string
Bar string
}
p := arg.MustParse(&args)
if args.Foo == "" && args.Bar == "" {
p.Fail("you must provide either --foo or --bar")
}
output is:
./example
Usage: samples [--foo FOO] [--bar BAR]
error: you must provide either --foo or --bar
Is this what you want?
(Also, in what way does p.WriteHelp(os.Stdout) not work?)
I am trying to get the usage message when failing to validate arguments passed
does not work and is not really relevant without the &args struct.
What is the best way to purposely call usage?
The text was updated successfully, but these errors were encountered: