-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
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
Negative numbers do not work with short version of flag #315
Comments
|
Ah I see. Well, I think I will stick with long versions for flags that can have negative values. Thank you making kong, I really like how simple it is to use ❤️ |
Though, if I may ask
Is that a convention? or is it something that kong does not support? |
It's a convention from GNU short flags. |
I tried this with echo "hello world" | head -c 5 echo "hello world" | head -c -5 I think Kong should support this form too. What do you think? |
Yeah I think it should. |
I tried fixing it with this: Samyak2@86d1f36 It did not work. I don't think that's the right approach as it should only be considered if it's followed by a short flag. Any pointers here? |
I have run into this issue, too. I have just ported a utility from Python and argparse to Go and Kong. In the Python version, the utility accepted arguments like |
Minimal reproducible example
The long version works as expected:
go run . --arg-a=-10
The short version:
Errors out:
Context
I did look at #166 (comment), but there was no info on whether it is expected that the short and long versions behave differently.
I would be willing to contribute a fix if this is an actual bug.
The text was updated successfully, but these errors were encountered: