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

Introduce +TOOLCHAIN syntax for proxies. #615

Merged
merged 1 commit into from
Jul 29, 2016

Conversation

DanielKeep
Copy link
Contributor

If the first argument to a proxy is of the form +TOOLCHAIN, then this
will be interpreted as the toolchain the user wants. That is,

cargo +nightly build

will be equivalent to

rustup run nightly cargo build

This is purely an ergonomic feature designed to reduce typing for people
who frequently switch toolchains (particularly for testing). It is
inspired by a similar feature in the Python launcher.

Why +TOOLCHAIN?

The obvious candidate (used by Python) of -TOOLCHAIN was a no-go.
The issue is that because toolchains can have arbitrary names, it is
difficult to distinguish between a toolchain and an actual argument to
the proxied program in the general case.

@TOOLCHAIN was also considered, as it reads somewhat naturally in
English. However, it turns out that @ is a meta character in
Powershell, which causes the next word to simply disappear from the
command line. Presumably, there is a reason for this.

+TOOLCHAIN was tested and found to not need escaping with CMD,
Powershell, bash, and fish.

If the first argument to a proxy is of the form `+TOOLCHAIN`, then this
will be interpreted as the toolchain the user wants.  That is,

    cargo +nightly build

will be equivalent to

    rustup run nightly cargo build

This is purely an ergonomic feature designed to reduce typing for people
who frequently switch toolchains (particularly for testing).  It is
inspired by a similar feature in the Python launcher.

**Why `+TOOLCHAIN`?**

The obvious candidate (used by Python) of `-TOOLCHAIN` was a no-go.
The issue is that because toolchains can have arbitrary names, it is
difficult to distinguish between a toolchain and an actual argument to
the proxied program in the general case.

`@TOOLCHAIN` was also considered, as it reads somewhat naturally in
English.  However, it turns out that `@` is a meta character in
Powershell, which causes the next word to simply *disappear* from the
command line.  Presumably, there is a reason for this.

`+TOOLCHAIN` was tested and found to not need escaping with CMD,
Powershell, bash, and fish.
@DanielKeep DanielKeep force-pushed the im-too-lazy-to-type-rustup-run branch from c2c52a6 to 990347e Compare July 26, 2016 00:36
@brson
Copy link
Contributor

brson commented Jul 29, 2016

Cool idea. I'm not sure what I think of the syntax, but your rationale is good. Let's get a build out and see what others think of it!

@brson brson merged commit 383c58f into rust-lang:master Jul 29, 2016
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 this pull request may close these issues.

2 participants