Reduce required args to new parser

This commit is contained in:
2022-06-06 19:06:50 -04:00
parent e3872e316d
commit d0c96803c8
3 changed files with 36 additions and 23 deletions

View File

@@ -15,16 +15,16 @@ func main() {
log.SetFlags(0)
pt, err := argh.ParseArgs(os.Args, argh.NewParserConfig(
&argh.CommandConfig{
NValue: argh.OneOrMoreValue,
ValueNames: []string{"topping"},
Flags: &argh.Flags{
Automatic: true,
},
pCfg := argh.NewParserConfig()
pCfg.Prog = argh.CommandConfig{
NValue: argh.OneOrMoreValue,
ValueNames: []string{"topping"},
Flags: &argh.Flags{
Automatic: true,
},
nil,
))
}
pt, err := argh.ParseArgs(os.Args, pCfg)
if err != nil {
log.Fatal(err)
}