diff options
author | geemili <minergeemili@gmail.com> | 2016-07-19 13:43:48 -0500 |
---|---|---|
committer | geemili <minergeemili@gmail.com> | 2016-07-19 13:43:48 -0500 |
commit | 182479d7affd5c596ba94ab008ae90d80a43cec2 (patch) | |
tree | 9837a5203e7066f3b58253dfd9fd0b01fe9adb84 /bin | |
parent | 3e7d921413320062143065330003926a31bb4437 (diff) |
Added in debug flag forwarding
Diffstat (limited to 'bin')
-rw-r--r-- | bin/src/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/src/main.rs b/bin/src/main.rs index 8c95adcf..ea046be1 100644 --- a/bin/src/main.rs +++ b/bin/src/main.rs @@ -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()) { |