Allow longer shorts #5377
Labels
A-parsing
Area: Parser's logic and needs it changed somehow.
C-enhancement
Category: Raise on the bar on expectations
S-waiting-on-design
Status: Waiting on user-facing design to be resolved before implementing
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: