@@ -38,6 +38,7 @@ pub enum Command {
3838 /// (Also respects MIRIFLAGS environment variable.)
3939 Run {
4040 dep : bool ,
41+ verbose : bool ,
4142 /// Flags that are passed through to `miri`.
4243 flags : Vec < OsString > ,
4344 } ,
@@ -90,7 +91,7 @@ Just check miri. <flags> are passed to `cargo check`.
9091Build miri, set up a sysroot and then run the test suite. <flags> are passed
9192to the final `cargo test` invocation.
9293
93- ./miri run [--dep] <flags>:
94+ ./miri run [--dep] [-v|--verbose] <flags>:
9495Build miri, set up a sysroot and then run the driver with the given <flags>.
9596(Also respects MIRIFLAGS environment variable.)
9697
@@ -132,10 +133,10 @@ Pull and merge Miri changes from the rustc repo. Defaults to fetching the latest
132133rustc commit. The fetched commit is stored in the `rust-version` file, so the
133134next `./miri toolchain` will install the rustc that just got pulled.
134135
135- ./miri rustc-push <github user> <branch>:
136+ ./miri rustc-push <github user> [ <branch>] :
136137Push Miri changes back to the rustc repo. This will pull a copy of the rustc
137138history 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`.
139140
140141 ENVIRONMENT VARIABLES
141142
@@ -162,12 +163,18 @@ fn main() -> Result<()> {
162163 Command :: Test { bless, flags : args. collect ( ) }
163164 }
164165 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.
168175 args. next ( ) . unwrap ( ) ;
169176 }
170- Command :: Run { dep, flags : args. collect ( ) }
177+ Command :: Run { dep, verbose , flags : args. collect ( ) }
171178 }
172179 Some ( "fmt" ) => Command :: Fmt { flags : args. collect ( ) } ,
173180 Some ( "clippy" ) => Command :: Clippy { flags : args. collect ( ) } ,
@@ -187,17 +194,12 @@ fn main() -> Result<()> {
187194 let github_user = args
188195 . next ( )
189196 . 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]`" )
198198 } ) ?
199199 . to_string_lossy ( )
200200 . into_owned ( ) ;
201+ let branch =
202+ args. next ( ) . unwrap_or_else ( || "miri-sync" . into ( ) ) . to_string_lossy ( ) . into_owned ( ) ;
201203 if args. next ( ) . is_some ( ) {
202204 bail ! ( "Too many arguments for `./miri rustc-push GITHUB_USER BRANCH`" ) ;
203205 }
0 commit comments