@@ -35,6 +35,13 @@ pub fn cli() -> Command {
3535                . value_name ( "PRECISE" ) 
3636                . requires ( "package-group" ) , 
3737        ) 
38+         . arg ( 
39+             flag ( 
40+                 "breaking" , 
41+                 "Upgrade [SPEC] to latest breaking versions, unless pinned (unstable)" , 
42+             ) 
43+             . short ( 'b' ) , 
44+         ) 
3845        . arg_silent_suggestion ( ) 
3946        . arg ( 
4047            flag ( "workspace" ,  "Only update the workspace packages" ) 
@@ -59,7 +66,8 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
5966            gctx. cli_unstable ( ) . msrv_policy , 
6067        ) ?; 
6168    } 
62-     let  ws = args. workspace ( gctx) ?; 
69+ 
70+     let  mut  ws = args. workspace ( gctx) ?; 
6371
6472    if  args. is_present_with_zero_values ( "package" )  { 
6573        print_available_packages ( & ws) ?; 
@@ -89,6 +97,24 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
8997        workspace :  args. flag ( "workspace" ) , 
9098        gctx, 
9199    } ; 
92-     ops:: update_lockfile ( & ws,  & update_opts) ?; 
100+ 
101+     if  args. flag ( "breaking" )  { 
102+         gctx. cli_unstable ( ) 
103+             . fail_if_stable_opt ( "--breaking" ,  12425 ) ?; 
104+ 
105+         let  upgrades = ops:: upgrade_manifests ( & mut  ws,  & update_opts. to_update ) ?; 
106+         ops:: resolve_ws ( & ws,  update_opts. dry_run ) ?; 
107+         ops:: write_manifest_upgrades ( & ws,  & upgrades,  update_opts. dry_run ) ?; 
108+ 
109+         if  update_opts. dry_run  { 
110+             update_opts
111+                 . gctx 
112+                 . shell ( ) 
113+                 . warn ( "aborting update due to dry run" ) ?; 
114+         } 
115+     }  else  { 
116+         ops:: update_lockfile ( & ws,  & update_opts) ?; 
117+     } 
118+ 
93119    Ok ( ( ) ) 
94120} 
0 commit comments