Skip to content
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

Command aliases #1091

Closed
ftxqxd opened this issue Dec 26, 2014 · 0 comments · Fixed by #2679
Closed

Command aliases #1091

ftxqxd opened this issue Dec 26, 2014 · 0 comments · Fixed by #2679
Labels
A-features Area: features — conditional compilation

Comments

@ftxqxd
Copy link

ftxqxd commented Dec 26, 2014

It would be nice if it were possible to set up aliases in .cargo/config; e.g.,

[alias]
b = "build"
t = "test"
rr = "run --release"
# etc.
@huonw huonw added the A-features Area: features — conditional compilation label Dec 26, 2014
sbeckeriv added a commit to sbeckeriv/cargo that referenced this issue Jul 7, 2016
Dearest Reviewer,

This pull request closes rust-lang#1091 which is a request to support aliases.
This is not as powerful as something like git's alias, however, I think
it sticks true to the original request.

I high jack the processing of the args. After a few flags are checked
and the args are parsed I check the config file for alias.COMMAND. If it
is there I split it like args does and replace args[1] (the original
command) with the alias command and its 'flags'.

I have also included default short hand commands b, t and r.

Thanks!
Becker
bors added a commit that referenced this issue Jul 13, 2016
Command alias or Alias command #1091

Dearest Reviewer,

This pull request closes #1091 which is a request to support aliases.
This is not as powerful as something like git's alias, however, I think
it sticks true to the original request.

I high jack the processing of the args. After a few flags are checked
and the args are parsed I check the config file for alias.COMMAND. If it
is there I split it like args does and replace args[1] (the original
command) with the alias command and its 'flags'.

As an extra measure I output the alias command with warn. I would be
willing to drop that or put it behind a verbose flag. Also the docs have
been updated.

Thanks!
Becker

<img width="784" alt="screen shot 2016-05-12 at 10 23 59 am" src="https://cloud.githubusercontent.com/assets/12170/15226012/d18a3336-1835-11e6-94c9-875a63a79856.png">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-features Area: features — conditional compilation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants