-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
[Feature Request] combined arguments like python argparse #187
Comments
Thanks for putting this comprehensive feature request together @lonnywong. I think it would be great to implement this. Currently, go-arg allows "short" arguments that are more than one character long. However, to implement this I think only single-character short arguments should be considered for combining in this way. This means that it'll still be okay to have multi-character short arguments, but those arguments just can't be combined together. I don't think we should allow things like It may happen that somebody defines several single-character short arguments, and also a conflicting multiple-character short argument such as:
In this case, if the user writes I will try to fine time to look into this. |
Thanks. We could do the exactly matches first. If it doesn't match any arguments, then try the combined parsing. If |
I have a solution, but probably not a good one. https://github.com/trzsz/go-arg/blob/ac5a9f75703f3e4186ade7da860f1a675e8765b2/parse.go#L568-L594 |
Combined arguments are convenience to use. e.g.,
ps -ef
,rm -rf
.go-arg test code
python argparse test code
test cases
The text was updated successfully, but these errors were encountered: