Fix the tests and avoid a regression

This commit is contained in:
Pierre Peltier 2019-12-05 11:04:06 +01:00 committed by Abin Simon
parent 80ab697fb9
commit f344f42bfe

View file

@ -74,7 +74,8 @@ impl Flags {
};
let recursive = matches.is_present("recursive");
let recursion_depth = match matches.value_of("depth") {
let recursion_input = matches.values_of("depth").and_then(|values| values.last());
let recursion_depth = match recursion_input {
Some(str) if recursive || layout == Layout::Tree => match str.parse::<usize>() {
Ok(val) => val,
Err(_) => {