11use std:: ffi:: { OsStr , OsString } ;
22use std:: path:: PathBuf ;
33
4- use cargo:: util:: command_prelude:: CommandExt ;
54use cargo:: util:: command_prelude:: { flag, multi_opt, opt} ;
5+ use cargo:: util:: command_prelude:: { get_ws_member_candidates, CommandExt } ;
66use cargo:: util:: { style, CliError , CliResult } ;
77
88use cargo_util:: { ProcessBuilder , ProcessError } ;
99
1010use clap:: { Arg , ArgAction , ArgMatches , Command , CommandFactory , Parser } ;
11+ use clap_complete:: ArgValueCandidates ;
1112
1213use crate :: target:: Target ;
1314
@@ -136,8 +137,7 @@ fn base_cli() -> Command {
136137 . arg_target_triple ( "Build for the target triple" )
137138 . arg_target_dir ( )
138139 . arg_manifest_path ( )
139- . arg_message_format ( )
140- . arg_build_plan ( ) ;
140+ . arg_message_format ( ) ;
141141
142142 if let Ok ( t) = default_target {
143143 app. mut_arg ( "prefix" , |a| {
@@ -166,6 +166,7 @@ pub fn subcommand_build(name: &'static str, about: &'static str) -> Command {
166166 "Package to build (see `cargo help pkgid`)" ,
167167 "Build all packages in the workspace" ,
168168 "Exclude packages from the build" ,
169+ ArgValueCandidates :: new ( get_ws_member_candidates) ,
169170 )
170171 . after_help (
171172 "
@@ -188,6 +189,7 @@ pub fn subcommand_install(name: &'static str, about: &'static str) -> Command {
188189 "Package to install (see `cargo help pkgid`)" ,
189190 "Install all packages in the workspace" ,
190191 "Exclude packages from being installed" ,
192+ ArgValueCandidates :: new ( get_ws_member_candidates) ,
191193 )
192194 . after_help (
193195 "
@@ -218,6 +220,7 @@ pub fn subcommand_test(name: &'static str) -> Command {
218220 "Package to run tests for" ,
219221 "Test all packages in the workspace" ,
220222 "Exclude packages from the test" ,
223+ ArgValueCandidates :: new ( get_ws_member_candidates) ,
221224 )
222225 . arg ( flag ( "no-run" , "Compile, but don't run tests" ) )
223226 . arg ( flag ( "no-fail-fast" , "Run all tests regardless of failure" ) )
0 commit comments