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

Alias for check #6215

Closed
ordovicia opened this issue Oct 24, 2018 · 3 comments · Fixed by #6218
Closed

Alias for check #6215

ordovicia opened this issue Oct 24, 2018 · 3 comments · Fixed by #6218

Comments

@ordovicia
Copy link
Contributor

How about adding cargo c alias for cargo check?

I believe that one of the most frequently used subcommands is check.
Adding this alias would save much time.

Currently, there are three aliases: b for build, r for run, and t for test.
I think that adding c alias would cover most of the use cases.

One problem I have come up with is that the clean subcommand also starts with the letter c.
But I believe that running check subcommand by mistake would not hurt developers so much.

I would like to prepare a PR for this change.

@ehuss
Copy link
Contributor

ehuss commented Oct 24, 2018

You can define your own aliases in ~/.cargo/config. They are briefly mentioned at the bottom of this page: https://doc.rust-lang.org/nightly/cargo/reference/config.html#configuration-keys

This is the alias that I personally use:

[alias]
c = ["check", "--all-targets"]

@ordovicia
Copy link
Contributor Author

I did not know the configuration. Thank you!

Still, I personally want the out-of-the-box c alias for check because the subcommand is frequently used.
I want to know how people feel about this addition.

@dwijnand
Copy link
Member

I would argue it warrants equal status in the single-char alias club. I'd say send the PR and let's see 🙂

bors added a commit that referenced this issue Nov 19, 2018
Add `c` alias for `check`

This PR adds `cargo c` alias for `cargo check`.

I believe that one of the most frequently used subcommands is `check`.
Adding this alias would save much time.

Currently, there are three aliases: `b` for `build`, `r` for `run`, `t` for `test`.
I think that adding out-of-the-box `c` alias is *natural* for many developers, and these aliases would cover most of the use cases.
We can add aliases via a configuration file, but I guess people would expect built-in `c` alias along with `b` and others.

One problem I have come up with is that the `clean` subcommand also starts with the letter `c`.
But I believe that running `check` subcommand by mistake would not hurt developers so much.

Fixes #6215
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants