Closed
Description
Hello, I already fix this issue in a dedicated PR
Describe the bug
When I define a command argument and a sub command, my argument is never handled.
To Reproduce
package main
import (
"fmt"
"github.com/hellflame/argparse"
)
func main() {
parser := argparse.NewParser("basic", "this is a basic program", nil)
name := parser.String("n", "name", nil)
subcmd := parser.AddCommand("a", "", nil)
if e := parser.Parse([]string{"-n", "world", "a"}); e != nil {
fmt.Println(e.Error())
return
}
fmt.Printf("hello %s\n", *t)
}
Expected behavior
Must display "hello world"
Terminal Output
hello
Environment:
- OS: MacOS 10.15
- Go Version: 1.13
- Package Version: v1.10.0
Resolution
I provided those two pull requests #19 & #20 which respectively solve my case and test the bugfix.
Regards
Additional context
Metadata
Metadata
Assignees
Labels
No labels