File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: command_prelude:: * ;
2
2
3
3
use cargo:: ops:: { self , CleanOptions } ;
4
+ use cargo:: util:: print_available_packages;
4
5
5
6
pub fn cli ( ) -> App {
6
7
subcommand ( "clean" )
@@ -18,6 +19,11 @@ pub fn cli() -> App {
18
19
19
20
pub fn exec ( config : & mut Config , args : & ArgMatches < ' _ > ) -> CliResult {
20
21
let ws = args. workspace ( config) ?;
22
+
23
+ if args. is_present_with_zero_values ( "package" ) {
24
+ print_available_packages ( & ws) ?;
25
+ }
26
+
21
27
let opts = CleanOptions {
22
28
config,
23
29
spec : values ( args, "package" ) ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use anyhow::{bail, format_err};
4
4
use cargo:: core:: dependency:: DepKind ;
5
5
use cargo:: ops:: tree:: { self , EdgeKind } ;
6
6
use cargo:: ops:: Packages ;
7
+ use cargo:: util:: print_available_packages;
7
8
use cargo:: util:: CargoResult ;
8
9
use std:: collections:: HashSet ;
9
10
use std:: str:: FromStr ;
@@ -176,6 +177,11 @@ subtree of the package given to -p.\n\
176
177
}
177
178
178
179
let ws = args. workspace ( config) ?;
180
+
181
+ if args. is_present_with_zero_values ( "package" ) {
182
+ print_available_packages ( & ws) ?;
183
+ }
184
+
179
185
let charset = tree:: Charset :: from_str ( args. value_of ( "charset" ) . unwrap ( ) )
180
186
. map_err ( |e| anyhow:: anyhow!( "{}" , e) ) ?;
181
187
let opts = tree:: TreeOptions {
Original file line number Diff line number Diff line change 1
1
use crate :: command_prelude:: * ;
2
2
3
3
use cargo:: ops:: { self , UpdateOptions } ;
4
+ use cargo:: util:: print_available_packages;
4
5
5
6
pub fn cli ( ) -> App {
6
7
subcommand ( "update" )
@@ -20,6 +21,10 @@ pub fn cli() -> App {
20
21
pub fn exec ( config : & mut Config , args : & ArgMatches < ' _ > ) -> CliResult {
21
22
let ws = args. workspace ( config) ?;
22
23
24
+ if args. is_present_with_zero_values ( "package" ) {
25
+ print_available_packages ( & ws) ?;
26
+ }
27
+
23
28
let update_opts = UpdateOptions {
24
29
aggressive : args. is_present ( "aggressive" ) ,
25
30
precise : args. value_of ( "precise" ) ,
You can’t perform that action at this time.
0 commit comments