Added in debug flag forwarding
This commit is contained in:
parent
3e7d921413
commit
182479d7af
1 changed files with 6 additions and 1 deletions
|
@ -125,6 +125,7 @@ fn main() {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
let is_debug = env::args().skip(1).filter(|x| x == "--debug").next().is_some();
|
||||||
|
|
||||||
match &first_arg[..] {
|
match &first_arg[..] {
|
||||||
"--help" | "-h" => {
|
"--help" | "-h" => {
|
||||||
|
@ -157,11 +158,15 @@ fn main() {
|
||||||
},
|
},
|
||||||
|
|
||||||
s => {
|
s => {
|
||||||
|
let subcommand_args = &find_args(s)[..];
|
||||||
|
if is_debug {
|
||||||
|
subcommand_args.push("--debug");
|
||||||
|
}
|
||||||
match Command::new(format!("imag-{}", s))
|
match Command::new(format!("imag-{}", s))
|
||||||
.stdin(Stdio::inherit())
|
.stdin(Stdio::inherit())
|
||||||
.stdout(Stdio::inherit())
|
.stdout(Stdio::inherit())
|
||||||
.stderr(Stdio::inherit())
|
.stderr(Stdio::inherit())
|
||||||
.args(&find_args(s)[..])
|
.args(subcommand_args)
|
||||||
.spawn()
|
.spawn()
|
||||||
.and_then(|mut handle| handle.wait())
|
.and_then(|mut handle| handle.wait())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue