File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ where
220
220
. canonicalize ( )
221
221
. map_err ( |err| format ! ( "Failed to canonicalize executable path: {}" , err) ) ?;
222
222
let mut run_command = None ;
223
+ let mut run_args = None ;
223
224
224
225
loop {
225
226
match arg_iter. next ( ) . as_ref ( ) . map ( |s| s. as_str ( ) ) {
@@ -230,6 +231,13 @@ where
230
231
}
231
232
break ;
232
233
}
234
+ Some ( "--args" ) => {
235
+ let old = mem:: replace ( & mut run_args, Some ( arg_iter. collect ( ) ) ) ;
236
+ if !old. is_none ( ) {
237
+ Err ( "multiple `--args` arguments" ) ?;
238
+ }
239
+ break ;
240
+ }
233
241
Some ( "--help" ) | Some ( "-h" ) => {
234
242
return Ok ( Command :: RunnerHelp ) ;
235
243
}
@@ -244,13 +252,15 @@ where
244
252
Ok ( Command :: Runner ( RunnerArgs {
245
253
executable,
246
254
run_command,
255
+ run_args : run_args,
247
256
} ) )
248
257
}
249
258
250
259
#[ derive( Debug , Clone ) ]
251
260
pub struct RunnerArgs {
252
261
pub executable : PathBuf ,
253
262
pub run_command : Option < Vec < String > > ,
263
+ pub run_args : Option < Vec < String > > ,
254
264
}
255
265
256
266
#[ derive( Debug , Clone ) ]
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ pub(crate) fn runner(args: RunnerArgs) -> Result<(), ErrorString> {
20
20
for arg in & run_cmd[ 1 ..] {
21
21
command. arg ( arg. replace ( "{bootimage}" , & format ! ( "{}" , bootimage_bin. display( ) ) ) ) ;
22
22
}
23
+ if let Some ( run_args) = args. run_args {
24
+ command. args ( run_args) ;
25
+ }
23
26
let output = command
24
27
. output ( )
25
28
. map_err ( |e| format ! ( "Failed to execute `{:?}`: {}" , command, e) ) ?;
You can’t perform that action at this time.
0 commit comments