Skip to content

Commit

Permalink
Merge pull request #2674 from chansuke/issues-2660
Browse files Browse the repository at this point in the history
Set `upgrade` to the alias of `update`
  • Loading branch information
kinnison authored Feb 20, 2021
2 parents 0b583e8 + b8c2067 commit 3c8f954
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ pub fn cli() -> App<'static, 'static> {
.subcommand(
SubCommand::with_name("update")
.about("Update Rust toolchains and rustup")
.aliases(&["upgrade"])
.after_help(UPDATE_HELP)
.arg(
Arg::with_name("toolchain")
Expand Down
30 changes: 30 additions & 0 deletions tests/cli-exact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,31 @@ info: default toolchain set to 'nightly-{0}'
fn update_again() {
setup(&|config| {
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
expect_ok(
config,
&["rustup", "upgrade", "nightly", "--no-self-update"],
);
expect_ok_ex(
config,
&["rustup", "update", "nightly", "--no-self-update"],
for_host!(
r"
nightly-{0} unchanged - 1.3.0 (hash-nightly-2)
"
),
for_host!(
r"info: syncing channel updates for 'nightly-{0}'
"
),
);
expect_ok_ex(
config,
&["rustup", "upgrade", "nightly", "--no-self-update"],
for_host!(
r"
nightly-{0} unchanged - 1.3.0 (hash-nightly-2)
"
),
for_host!(
Expand All @@ -73,6 +91,12 @@ fn check_updates_none() {
expect_ok(config, &["rustup", "update", "stable", "--no-self-update"]);
expect_ok(config, &["rustup", "update", "beta", "--no-self-update"]);
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
expect_ok(config, &["rustup", "upgrade", "stable", "--no-self-update"]);
expect_ok(config, &["rustup", "upgrade", "beta", "--no-self-update"]);
expect_ok(
config,
&["rustup", "upgrade", "nightly", "--no-self-update"],
);
expect_stdout_ok(
config,
&["rustup", "check"],
Expand All @@ -93,6 +117,12 @@ fn check_updates_some() {
expect_ok(config, &["rustup", "update", "stable", "--no-self-update"]);
expect_ok(config, &["rustup", "update", "beta", "--no-self-update"]);
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
expect_ok(config, &["rustup", "upgrade", "stable", "--no-self-update"]);
expect_ok(config, &["rustup", "upgrade", "beta", "--no-self-update"]);
expect_ok(
config,
&["rustup", "upgrade", "nightly", "--no-self-update"],
);
set_current_dist_date(config, "2015-01-02");
expect_stdout_ok(
config,
Expand Down

0 comments on commit 3c8f954

Please sign in to comment.