summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMario Krehl <mkrehl@science-computing.de>2016-09-07 10:12:55 +0200
committerMario Krehl <mkrehl@science-computing.de>2016-09-07 10:21:59 +0200
commit5ea5f588a964e46fefcac1efabb7f241c719f7ac (patch)
tree7ce1395d53234f8e20b3ede623c67eb3f63214a5 /bin
parentd19243e7a8942646e1b3529c61c246862fe31daa (diff)
Fix panics due to unwrap on Option::None
Diffstat (limited to 'bin')
-rw-r--r--bin/src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/src/main.rs b/bin/src/main.rs
index 25d47ce3..12af035e 100644
--- a/bin/src/main.rs
+++ b/bin/src/main.rs
@@ -170,7 +170,11 @@ fn main() {
match matches.subcommand() {
(subcommand, Some(scmd)) => {
- let subcommand_args : Vec<&str> = scmd.values_of("").unwrap().collect();
+ debug!("Calling with subcommand: {}", subcommand);
+ let subcommand_args : Vec<&str> = match scmd.values_of("") {
+ Some(values) => values.collect(),
+ None => Vec::new()
+ };
debug!("Calling 'imag-{}' with args: {:?}", subcommand, subcommand_args);
match Command::new(format!("imag-{}", subcommand))