Skip to content

Commit 3c8f954

Browse files
authored
Merge pull request #2674 from chansuke/issues-2660
Set `upgrade` to the alias of `update`
2 parents 0b583e8 + b8c2067 commit 3c8f954

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/cli/rustup_mode.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ pub fn cli() -> App<'static, 'static> {
297297
.subcommand(
298298
SubCommand::with_name("update")
299299
.about("Update Rust toolchains and rustup")
300+
.aliases(&["upgrade"])
300301
.after_help(UPDATE_HELP)
301302
.arg(
302303
Arg::with_name("toolchain")

tests/cli-exact.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,31 @@ info: default toolchain set to 'nightly-{0}'
4949
fn update_again() {
5050
setup(&|config| {
5151
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
52+
expect_ok(
53+
config,
54+
&["rustup", "upgrade", "nightly", "--no-self-update"],
55+
);
5256
expect_ok_ex(
5357
config,
5458
&["rustup", "update", "nightly", "--no-self-update"],
5559
for_host!(
5660
r"
5761
nightly-{0} unchanged - 1.3.0 (hash-nightly-2)
5862
63+
"
64+
),
65+
for_host!(
66+
r"info: syncing channel updates for 'nightly-{0}'
67+
"
68+
),
69+
);
70+
expect_ok_ex(
71+
config,
72+
&["rustup", "upgrade", "nightly", "--no-self-update"],
73+
for_host!(
74+
r"
75+
nightly-{0} unchanged - 1.3.0 (hash-nightly-2)
76+
5977
"
6078
),
6179
for_host!(
@@ -73,6 +91,12 @@ fn check_updates_none() {
7391
expect_ok(config, &["rustup", "update", "stable", "--no-self-update"]);
7492
expect_ok(config, &["rustup", "update", "beta", "--no-self-update"]);
7593
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
94+
expect_ok(config, &["rustup", "upgrade", "stable", "--no-self-update"]);
95+
expect_ok(config, &["rustup", "upgrade", "beta", "--no-self-update"]);
96+
expect_ok(
97+
config,
98+
&["rustup", "upgrade", "nightly", "--no-self-update"],
99+
);
76100
expect_stdout_ok(
77101
config,
78102
&["rustup", "check"],
@@ -93,6 +117,12 @@ fn check_updates_some() {
93117
expect_ok(config, &["rustup", "update", "stable", "--no-self-update"]);
94118
expect_ok(config, &["rustup", "update", "beta", "--no-self-update"]);
95119
expect_ok(config, &["rustup", "update", "nightly", "--no-self-update"]);
120+
expect_ok(config, &["rustup", "upgrade", "stable", "--no-self-update"]);
121+
expect_ok(config, &["rustup", "upgrade", "beta", "--no-self-update"]);
122+
expect_ok(
123+
config,
124+
&["rustup", "upgrade", "nightly", "--no-self-update"],
125+
);
96126
set_current_dist_date(config, "2015-01-02");
97127
expect_stdout_ok(
98128
config,

0 commit comments

Comments
 (0)