Skip to content

Commit

Permalink
Merge pull request #1073 from jordanhiltunen/master
Browse files Browse the repository at this point in the history
Alias 'rustup toolchain uninstall' to 'rustup uninstall'
  • Loading branch information
Diggsey authored Apr 19, 2017
2 parents 77021f8 d327470 commit f7e0a9e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
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

0 comments on commit f7e0a9e

Please sign in to comment.