projectdiscovery / goflags

A go flag wrapper with convenience helpers
MIT License
84 stars 16 forks source link

DynamicVar incorrect parsing on bool values #150

Closed RamanaReddy0M closed 1 year ago

RamanaReddy0M commented 1 year ago

when we pass t,f,true,false,0,1 as dynamic flag values, always returns default value.

ex:

...
flagset.DynamicVar(&options.hasPoc, "poc", "true", "display cves that has public published poc"),
...
$ go run . -poc=false  # hasPoc = true
$ go run . -poc #haPoc=true

expected:

$ go run . -poc=false  # hasPoc = false
$ go run . -poc # haPoc=true