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 'rustup toolchain uninstall' to 'rustup uninstall' #1073

Merged
merged 1 commit into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/rustup-cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 31,7 @@ pub fn main() -> Result<()> {
("show", Some(_)) => try!(show(cfg)),
("install", Some(m)) => try!(update(cfg, m)),
("update", Some(m)) => try!(update(cfg, m)),
("uninstall", Some(m)) => try!(toolchain_remove(cfg, m)),
("default", Some(m)) => try!(default_(cfg, m)),
("toolchain", Some(c)) => {
match c.subcommand() {
Expand Down Expand Up @@ -133,6 134,12 @@ pub fn cli() -> App<'static, 'static> {
.arg(Arg::with_name("toolchain")
.required(true)
.multiple(true)))
.subcommand(SubCommand::with_name("uninstall")
.about("Uninstall Rust toolchains")
.setting(AppSettings::Hidden) // synonym for 'toolchain uninstall'
.arg(Arg::with_name("toolchain")
.required(true)
.multiple(true)))
.subcommand(SubCommand::with_name("update")
.about("Update Rust toolchains")
.after_help(UPDATE_HELP)
Expand Down
16 changes: 16 additions & 0 deletions tests/cli-rustup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 567,22 @@ fn toolchain_update_is_like_update() {
});
}


#[test]
fn toolchain_uninstall_is_like_uninstall() {
setup(&|config| {
expect_ok(config, &["rustup", "uninstall", "nightly"]);
let mut cmd = clitools::cmd(config, "rustup", &["show"]);
clitools::env(config, &mut cmd);
let out = cmd.output().unwrap();
assert!(out.status.success());
let stdout = String::from_utf8(out.stdout).unwrap();
assert!(!stdout.contains(
for_host!("'nightly-2015-01-01-{}'")));

});
}

#[test]
fn toolchain_update_is_like_update_except_that_bare_install_is_an_error() {
setup(&|config| {
Expand Down