You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project that needs to offer 2 shorthand flags (-s and -t) for the same argument in order to conform to a reference implementation from another language. The latter of the two is hidden and exists only for backwards compatibility; however, some old tools only use the hidden form of the flag.
Describe the solution you'd like
I'd be looking for something similar to Arg::alias but for shorthand arguments. It would probably make sense to have the signature look like
It shouldn't be too hard to just add a hidden flag and then check if either are set, but it seems unintuitive to only allow aliasing of long arguments.
The text was updated successfully, but these errors were encountered:
Does that mean we need to rename alias to long_alias and other methods similarly?
I hadn't thought that far yet.... ugh. 😟
... [ thinking intensifies ] ...
I'd say no. So long as the docs are explicit that alias is for longs, and if they wish to find something similar but for shorts, look for short_alias I think it's fine.
Make sure you completed the following tasks
Describe your use case
I have a project that needs to offer 2 shorthand flags (
-s
and-t
) for the same argument in order to conform to a reference implementation from another language. The latter of the two is hidden and exists only for backwards compatibility; however, some old tools only use the hidden form of the flag.Describe the solution you'd like
I'd be looking for something similar to
Arg::alias
but for shorthand arguments. It would probably make sense to have the signature look likethat adds a hidden shorthand alias.
The relevant code
clap/src/build/arg/mod.rs
Line 358 in 70287ea
Alternatives, if applicable
It shouldn't be too hard to just add a hidden flag and then check if either are set, but it seems unintuitive to only allow aliasing of long arguments.
The text was updated successfully, but these errors were encountered: