mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Clap: use default_value on input
This avoids uses one less 'match' statement
This commit is contained in:
+5
-7
@@ -205,15 +205,13 @@ fn main() {
|
|||||||
.number_of_values(1)
|
.number_of_values(1)
|
||||||
.help("Specify width of output overriding the auto detection of terminal width"),
|
.help("Specify width of output overriding the auto detection of terminal width"),
|
||||||
)
|
)
|
||||||
.arg(Arg::with_name("inputs").multiple(true))
|
.arg(Arg::with_name("inputs").multiple(true).default_value("."))
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
let target_dirs = {
|
let target_dirs = options
|
||||||
match options.values_of("inputs") {
|
.values_of("inputs")
|
||||||
None => vec!["."],
|
.expect("Should be a default value here")
|
||||||
Some(r) => r.collect(),
|
.collect();
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let summarize_file_types = options.is_present("types");
|
let summarize_file_types = options.is_present("types");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user