-
Notifications
You must be signed in to change notification settings - Fork 25
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
[Request] Allow short option to not be first letter of long #247
Comments
Sorry - this got labeled a bug automatically, I don't think it's that :-) |
Yes, this is intended for the macro interface, this is because the macro interface is essentially the overlapping semantic between Julia and the shell script, I think allowing this confuses quite a lot, e.g the options are all Julia keywords, the macro interface aims to make sure things are readable by just reading Julia code. Thus I'd recommend you to not use a different first letter, I don't think it's a good style... But... if you really really want to do this, you can directly construct the CLI object, then call the emit function manually, that way you have the flexibility and not restricted by any Julia semantic. https://github.com/comonicon/Comonicon.jl/blob/main/test/codegen/bash.jl#L42 |
actually, maybe we can let this issue open for a while to see if there are new opinions, but this has been a quite long behavior in this package, so I cannot change anything until the next minor release. |
I can understand this completely, but enforcing style with an error if there's not a technical limitation seems odd to me 🤷 (particularly when there's a long tradition of command line tools that violate this style). Appreciate the consideration! |
Is there any updates on this request? I voted for @kescobo , since I used diff short and long first letters often. Besides, many popular CLIs in bioinformatic field use this style, and considering their extensive user base, we usually need to set parameters close to them for users to better adapt to our tools. for example, a widely used tool samtools:
|
Is there a reason (other than preference) for this to error?
It seems pretty common to have single letter options that are different from the first letter of the long option,
either for style (eg
-x
==--extract
) or because multiple options start with the same letter (I ran into this because I have--debug
and--default
options, this means that only one can have a one-letter version).The text was updated successfully, but these errors were encountered: