-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Allow longer shorts #5377
Comments
Renamed the title to focus on the problem, rather than solution. I know this has been discussed before but not finding the Issues or Discussions for it. #1210 is either similar or the same thing, depending on your perspective. There are several problems to solve
If this is more like #1210, then #2468 is likely the way forward. |
I noticed that in v2, clap short allowed multiple characters, but only the first one was retrieved.
I think developing a way to regulate whether or not composition behavior is used is a very important feature for developers and users.
I am aware of these issues and hope such issues can be resolved.
Finally, I wish clap better and better! |
Please complete the following tasks
Clap Version
4.5.1
Describe your use case
Let
short
flag allow more characters than one to facilitate user input.I know that short flags implement their combined behavior by default in clap, which prevents
short
flags from using more than two characters.For example,
ls -l-a = ls -la
, which I think is a great feature.However, implementing only this functionality ignores the case where the user does not want to enter the
long
flag if there are too many parameters.For example, the user wants to type
xxx-oJ
instead ofxxx --oJ
Describe the solution you'd like
I have a solution, which is that clap can open a method to control whether I want this default composition behavior or not.
When I turn off the composition behavior, the
short
flag length is at least 1 or greater.For example,
-oJ
, the output is json, there is no combined behavior here, just a single instance.When I enable the composition behavior (which is the default), the
short
flag is limited to a length of 1.Which is now the composition behavior.
Alternatives, if applicable
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: