-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat(arg_aliases): Ability to alias arguments #674
Conversation
Thanks for the pull request, and welcome! The team is excited to review your changes, and you should hear from @Vinatorul (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
a616a39
to
f8b4c92
Compare
Uhmm 🤔 I think the pipeline is broken, at least for windows since appveryor is not even compiling the binary, I wonder if I need to look into it? cc/ @Vinatorul @kbknapp |
fa00436
to
771c4c7
Compare
@tormol Thank you for that advice! 👍 The new nightly rust version has some new warning that I already fixed sooo we are green now! ✅ |
@kbknapp Fantastic! I'm on it!! |
There are some cases where you need to have an argument to have an alias, an example could be when you depricate one option in favor of another one. Now you are going to be able to alias arguments as follows: ``` Arg::with_name("opt") .long("opt") .short("o") .takes_value(true) .alias("invisible") .visible_alias("visible") ``` Closes clap-rs#669
Signed-off-by: Salim Afiune <afiune@chef.io>
Added same alias funtionality for flags, now you can do: ``` Arg::with_name("flg") .long("flag") .short("f") .alias("not_visible_flag") .visible_alias("awesome_v_flag") ``` Signed-off-by: Salim Afiune <afiune@chef.io>
The new version of rustc 1.14.0-nightly (144af3e97 2016-10-02) has new linting warnings/errors. This commit fixes them. Signed-off-by: Salim Afiune <afiune@chef.io>
771c4c7
to
905d3b9
Compare
@kbknapp Rebased and test passing.. I think we are ready to merge!!! |
@homu r+ |
📌 Commit 905d3b9 has been approved by |
feat(arg_aliases): Ability to alias arguments There are some cases where you need to have an argument to have an alias, an example could be when you deprecate one option in favor of another one. Now you are going to be able to alias arguments as follows: ```rust Arg::with_name("opt") .long("opt") .short("o") .takes_value(true) .alias("invisible") .visible_alias("visible") ``` Closes #669 Also you can alias flags as follow: ```rust Arg::with_name("flg") .long("flag") .short("f") .alias("not_visible_flag") .visible_alias("awesome_v_flag") ```
feat(arg_aliases): Ability to alias arguments There are some cases where you need to have an argument to have an alias, an example could be when you deprecate one option in favor of another one. Now you are going to be able to alias arguments as follows: ```rust Arg::with_name("opt") .long("opt") .short("o") .takes_value(true) .alias("invisible") .visible_alias("visible") ``` Closes #669 Also you can alias flags as follow: ```rust Arg::with_name("flg") .long("flag") .short("f") .alias("not_visible_flag") .visible_alias("awesome_v_flag") ```
☀️ Test successful - status |
@kbknapp Thank you for approving this!! 😄 I have one last question, when/how is the release process to be able to use this code? Anything I can do to help? Thanks again!! 🎉 |
@afiune I'll be releasing the new version to crates.io tonight when I get home. 😉 |
We have contribute to the community with the PR clap-rs/clap#674 and now we are able to alias arguments natively. Same functionality no improvements. Signed-off-by: Salim Afiune <afiune@chef.io>
There are some cases where you need to have an argument to have an
alias, an example could be when you deprecate one option in favor of
another one.
Now you are going to be able to alias arguments as follows:
Closes #669
Also you can alias flags as follow: