We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi. After the merge of the big rewrite about a week ago it seems that [-vvv] handling is broken. Before, something along
[-vvv]
Options: mybin [-vvv] act
With args[“-v”].(int) would take values from 0 to 3 for the inputs:
args[“-v”].(int)
mybin act
mybin -v act
mybin -vv act
mybin -vvv act
Now with the new parser and the new API args.Int(“-v”) gives a value of 0 and an error along the lines of “this is uncastable” for any amount of Vs.
args.Int(“-v”)
I will work on creating a minimal example that uses both APIs tomorrow. I don’t remember that I found this usage in the golang examples/tests.
But then I am maybe just misusing the newer api. What do you think? cc @aviddiviner
The text was updated successfully, but these errors were encountered:
Note: this is saying that #36 was half solved, at least before the rewrite.
Sorry, something went wrong.
Ah! args.Int("-v") failed with key: "-v" failed type conversion because it's already an int! Solved it by just using args["-v"].(int).
args.Int("-v")
key: "-v" failed type conversion
int
args["-v"].(int)
Maybe opts.go Int,Float64 funcs could have a case that checks reflect.TypeOf before attempting strconv? I can make that PR if you'd like.
reflect.TypeOf
strconv
Anyhow, this is more of feature request than a bugfix. Issue solved.
No branches or pull requests
Hi. After the merge of the big rewrite about a week ago it seems that
[-vvv]
handling is broken.Before, something along
With
args[“-v”].(int)
would take values from 0 to 3 for the inputs:mybin act
mybin -v act
mybin -vv act
mybin -vvv act
Now with the new parser and the new API
args.Int(“-v”)
gives a value of 0 and an error along the lines of “this is uncastable” for any amount of Vs.I will work on creating a minimal example that uses both APIs tomorrow. I don’t remember that I found this usage in the golang examples/tests.
But then I am maybe just misusing the newer api. What do you think?
cc @aviddiviner
The text was updated successfully, but these errors were encountered: