Added in debug flag forwarding

This commit is contained in:
geemili 2016-07-19 13:43:48 -05:00
parent 3e7d921413
commit 182479d7af
1 changed files with 6 additions and 1 deletions

View File

@ -125,6 +125,7 @@ fn main() {
},
},
};
let is_debug = env::args().skip(1).filter(|x| x == "--debug").next().is_some();
match &first_arg[..] {
"--help" | "-h" => {
@ -157,11 +158,15 @@ fn main() {
},
s => {
let subcommand_args = &find_args(s)[..];
if is_debug {
subcommand_args.push("--debug");
}
match Command::new(format!("imag-{}", s))
.stdin(Stdio::inherit())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.args(&find_args(s)[..])
.args(subcommand_args)
.spawn()
.and_then(|mut handle| handle.wait())
{