@@ -35,6 +35,13 @@ pub fn cli() -> Command {
35
35
. value_name ( "PRECISE" )
36
36
. requires ( "package-group" ) ,
37
37
)
38
+ . arg (
39
+ flag (
40
+ "breaking" ,
41
+ "Upgrade [SPEC] to latest breaking versions, unless pinned (unstable)" ,
42
+ )
43
+ . short ( 'b' ) ,
44
+ )
38
45
. arg_silent_suggestion ( )
39
46
. arg (
40
47
flag ( "workspace" , "Only update the workspace packages" )
@@ -59,7 +66,8 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
59
66
gctx. cli_unstable ( ) . msrv_policy ,
60
67
) ?;
61
68
}
62
- let ws = args. workspace ( gctx) ?;
69
+
70
+ let mut ws = args. workspace ( gctx) ?;
63
71
64
72
if args. is_present_with_zero_values ( "package" ) {
65
73
print_available_packages ( & ws) ?;
@@ -89,6 +97,24 @@ pub fn exec(gctx: &mut GlobalContext, args: &ArgMatches) -> CliResult {
89
97
workspace : args. flag ( "workspace" ) ,
90
98
gctx,
91
99
} ;
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
+
93
119
Ok ( ( ) )
94
120
}
0 commit comments