@@ -38,6 +38,7 @@ pub enum Command {
38
38
/// (Also respects MIRIFLAGS environment variable.)
39
39
Run {
40
40
dep : bool ,
41
+ verbose : bool ,
41
42
/// Flags that are passed through to `miri`.
42
43
flags : Vec < OsString > ,
43
44
} ,
@@ -90,7 +91,7 @@ Just check miri. <flags> are passed to `cargo check`.
90
91
Build miri, set up a sysroot and then run the test suite. <flags> are passed
91
92
to the final `cargo test` invocation.
92
93
93
- ./miri run [--dep] <flags>:
94
+ ./miri run [--dep] [-v|--verbose] <flags>:
94
95
Build miri, set up a sysroot and then run the driver with the given <flags>.
95
96
(Also respects MIRIFLAGS environment variable.)
96
97
@@ -132,10 +133,10 @@ Pull and merge Miri changes from the rustc repo. Defaults to fetching the latest
132
133
rustc commit. The fetched commit is stored in the `rust-version` file, so the
133
134
next `./miri toolchain` will install the rustc that just got pulled.
134
135
135
- ./miri rustc-push <github user> <branch>:
136
+ ./miri rustc-push <github user> [ <branch>] :
136
137
Push Miri changes back to the rustc repo. This will pull a copy of the rustc
137
138
history into the Miri repo, unless you set the RUSTC_GIT env var to an existing
138
- clone of the rustc repo.
139
+ clone of the rustc repo. The branch defaults to `miri-sync`.
139
140
140
141
ENVIRONMENT VARIABLES
141
142
@@ -162,12 +163,18 @@ fn main() -> Result<()> {
162
163
Command :: Test { bless, flags : args. collect ( ) }
163
164
}
164
165
Some ( "run" ) => {
165
- let dep = args. peek ( ) . is_some_and ( |a| a. to_str ( ) == Some ( "--dep" ) ) ;
166
- if dep {
167
- // Consume the flag.
166
+ let mut dep = false ;
167
+ let mut verbose = false ;
168
+ while let Some ( arg) = args. peek ( ) . and_then ( |a| a. to_str ( ) ) {
169
+ match arg {
170
+ "--dep" => dep = true ,
171
+ "-v" | "--verbose" => verbose = true ,
172
+ _ => break , // not for us
173
+ }
174
+ // Consume the flag, look at the next one.
168
175
args. next ( ) . unwrap ( ) ;
169
176
}
170
- Command :: Run { dep, flags : args. collect ( ) }
177
+ Command :: Run { dep, verbose , flags : args. collect ( ) }
171
178
}
172
179
Some ( "fmt" ) => Command :: Fmt { flags : args. collect ( ) } ,
173
180
Some ( "clippy" ) => Command :: Clippy { flags : args. collect ( ) } ,
@@ -187,17 +194,12 @@ fn main() -> Result<()> {
187
194
let github_user = args
188
195
. next ( )
189
196
. ok_or_else ( || {
190
- anyhow ! ( "Missing first argument for `./miri rustc-push GITHUB_USER BRANCH`" )
191
- } ) ?
192
- . to_string_lossy ( )
193
- . into_owned ( ) ;
194
- let branch = args
195
- . next ( )
196
- . ok_or_else ( || {
197
- anyhow ! ( "Missing second argument for `./miri rustc-push GITHUB_USER BRANCH`" )
197
+ anyhow ! ( "Missing first argument for `./miri rustc-push GITHUB_USER [BRANCH]`" )
198
198
} ) ?
199
199
. to_string_lossy ( )
200
200
. into_owned ( ) ;
201
+ let branch =
202
+ args. next ( ) . unwrap_or_else ( || "miri-sync" . into ( ) ) . to_string_lossy ( ) . into_owned ( ) ;
201
203
if args. next ( ) . is_some ( ) {
202
204
bail ! ( "Too many arguments for `./miri rustc-push GITHUB_USER BRANCH`" ) ;
203
205
}
0 commit comments