Allow an arbitrary number of additional arguments
This commit is contained in:
parent
0bfe5f1a12
commit
80f8482a95
@ -18,8 +18,8 @@ struct Cli {
|
|||||||
cols: usize,
|
cols: usize,
|
||||||
/// Number of rows in a frame
|
/// Number of rows in a frame
|
||||||
rows: usize,
|
rows: usize,
|
||||||
/// Free-format argument to pass to the executable
|
/// Free-format arguments to pass to the executable
|
||||||
arg: String,
|
args: Vec<String>,
|
||||||
/// Frame rate for displaying
|
/// Frame rate for displaying
|
||||||
#[arg(short, long, default_value_t = 25)]
|
#[arg(short, long, default_value_t = 25)]
|
||||||
frame_rate: u64,
|
frame_rate: u64,
|
||||||
@ -37,7 +37,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
|||||||
let mut child = process::Command::new(&cli.executable)
|
let mut child = process::Command::new(&cli.executable)
|
||||||
.arg(cli.cols.to_string())
|
.arg(cli.cols.to_string())
|
||||||
.arg(cli.rows.to_string())
|
.arg(cli.rows.to_string())
|
||||||
.arg(cli.arg)
|
.args(cli.args)
|
||||||
.stdout(process::Stdio::piped())
|
.stdout(process::Stdio::piped())
|
||||||
.spawn()?;
|
.spawn()?;
|
||||||
if cli.debug >= 1 {
|
if cli.debug >= 1 {
|
||||||
|
Loading…
Reference in New Issue
Block a user