diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index 3347d8c9d41a..325e765f29ca 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -132,11 +132,14 @@ pub trait AppExt: Sized { } fn arg_features(self) -> Self { - self._arg(multi_opt( - "features", - "FEATURES", - "Space or comma separated list of features to activate", - )) + self._arg( + multi_opt( + "features", + "FEATURES", + "Space or comma separated list of features to activate", + ) + .short('F'), + ) ._arg(opt("all-features", "Activate all available features")) ._arg(opt( "no-default-features", diff --git a/src/etc/_cargo b/src/etc/_cargo index 519ae45de157..3b07b25db6da 100644 --- a/src/etc/_cargo +++ b/src/etc/_cargo @@ -51,8 +51,8 @@ _cargo() { ) features=( - '(--all-features)--features=[specify features to activate]:feature' - '(--features)--all-features[activate all available features]' + '(--all-features)'{-F+,--features=}'[specify features to activate]:feature' + '(--features -F)--all-features[activate all available features]' "--no-default-features[don't build the default features]" ) diff --git a/src/etc/cargo.bashcomp.sh b/src/etc/cargo.bashcomp.sh index fb4880ca082c..77b3e8c30c3b 100644 --- a/src/etc/cargo.bashcomp.sh +++ b/src/etc/cargo.bashcomp.sh @@ -39,7 +39,7 @@ _cargo() local opt_common="$opt_help $opt_verbose $opt_quiet $opt_color" local opt_pkg_spec='-p --package --all --exclude --workspace' local opt_pkg='-p --package' - local opt_feat='--features --all-features --no-default-features' + local opt_feat='-F --features --all-features --no-default-features' local opt_mani='--manifest-path' local opt_parallel='-j --jobs --keep-going' local opt_force='-f --force'