Skip to content

Commit cf474a5

Browse files
committed
Auto merge of #10133 - joshtriplett:release-short, r=ehuss
Support abbreviating `--release` as `-r` Of the options people regularly pass to cargo, `--release` seems by far the most common. Yet even on the command line, we expect people to type out `--release`. Add a short version `-r`, and add some tests in the testsuite that confirm it works.
2 parents f9089fc + c92d917 commit cf474a5

28 files changed

+68
-10
lines changed

src/cargo/util/command_prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub trait AppExt: Sized {
142142
}
143143

144144
fn arg_release(self, release: &'static str) -> Self {
145-
self._arg(opt("release", release))
145+
self._arg(opt("release", release).short("r"))
146146
}
147147

148148
fn arg_profile(self, profile: &'static str) -> Self {

src/doc/man/generated_txt/cargo-build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ OPTIONS
142142
<https://doc.rust-lang.org/cargo/guide/build-cache.html>
143143
documentation for more details.
144144

145-
--release
145+
-r, --release
146146
Build optimized artifacts with the release profile. See also the
147147
--profile option for choosing a specific profile by name.
148148

src/doc/man/generated_txt/cargo-check.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ OPTIONS
148148
<https://doc.rust-lang.org/cargo/guide/build-cache.html>
149149
documentation for more details.
150150

151-
--release
151+
-r, --release
152152
Check optimized artifacts with the release profile. See also the
153153
--profile option for choosing a specific profile by name.
154154

src/doc/man/generated_txt/cargo-doc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ OPTIONS
126126
<https://doc.rust-lang.org/cargo/guide/build-cache.html>
127127
documentation for more details.
128128

129-
--release
129+
-r, --release
130130
Document optimized artifacts with the release profile. See also the
131131
--profile option for choosing a specific profile by name.
132132

src/doc/man/generated_txt/cargo-fix.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ OPTIONS
221221
<https://doc.rust-lang.org/cargo/guide/build-cache.html>
222222
documentation for more details.
223223

224-
--release
224+
-r, --release
225225
Fix optimized artifacts with the release profile. See also the
226226
--profile option for choosing a specific profile by name.
227227

src/doc/man/generated_txt/cargo-run.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ OPTIONS
7171
<https://doc.rust-lang.org/cargo/guide/build-cache.html>
7272
documentation for more details.
7373

74-
--release
74+
-r, --release
7575
Run optimized artifacts with the release profile. See also the
7676
--profile option for choosing a specific profile by name.
7777

src/doc/man/generated_txt/cargo-rustc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ OPTIONS
133133
<https://doc.rust-lang.org/cargo/guide/build-cache.html>
134134
documentation for more details.
135135

136-
--release
136+
-r, --release
137137
Build optimized artifacts with the release profile. See also the
138138
--profile option for choosing a specific profile by name.
139139

src/doc/man/generated_txt/cargo-rustdoc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ OPTIONS
142142
<https://doc.rust-lang.org/cargo/guide/build-cache.html>
143143
documentation for more details.
144144

145-
--release
145+
-r, --release
146146
Document optimized artifacts with the release profile. See also the
147147
--profile option for choosing a specific profile by name.
148148

src/doc/man/generated_txt/cargo-test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ OPTIONS
219219
<https://doc.rust-lang.org/cargo/guide/build-cache.html>
220220
documentation for more details.
221221

222-
--release
222+
-r, --release
223223
Test optimized artifacts with the release profile. See also the
224224
--profile option for choosing a specific profile by name.
225225

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{#option "`--release`"}}
1+
{{#option "`-r`" "`--release`"}}
22
{{actionverb}} optimized artifacts with the `release` profile.
33
See also the `--profile` option for choosing a specific profile by name.
44
{{/option}}

0 commit comments

Comments
 (0)