getopt
getopt copied to clipboard
Visit() does not work
Hello!
I'm trying to combine this package with a solution from this answer:
func isFlagPassed(name string) bool { found := false flag.Visit(func(f *flag.Flag) { if f.Name == name { found = true } }) return found }
Unfortunely, it does not work, because getopt.Parse() doesn't update underlying flag.FlagSet.actual. I know it cannot do it directly. But the fact is that Visit() does not work AND this is not documented.
@Vovan-VE were you able to make it work, if not, what did you do instead?
@Chaitanyabsprip , I already forget about this. I used https://github.com/alexflint/go-arg last time.