diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-09-30 10:47:38 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-09-30 10:47:38 +0200 |
commit | 4d2ac38ceb2a7fcbf47b8f6d5e7857602b4a3cc0 (patch) | |
tree | cfabc7c0d488648b157676bc5de6b9136167552b /imag-ref | |
parent | f8ed44c1e70fd6c2c1c8d6b021f4e43d7c99c17a (diff) |
imag-ref: Use validator is_existing_path
Diffstat (limited to 'imag-ref')
-rw-r--r-- | imag-ref/src/ui.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/imag-ref/src/ui.rs b/imag-ref/src/ui.rs index e884c90f..37cbb799 100644 --- a/imag-ref/src/ui.rs +++ b/imag-ref/src/ui.rs @@ -1,5 +1,7 @@ use clap::{Arg, App, SubCommand}; +use libimagutil::cli_validators::is_existing_path; + pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { app .subcommand(SubCommand::with_name("add") @@ -11,6 +13,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .takes_value(true) .required(true) .help("The path of the file") + .validator(is_existing_path) .value_name("PATH")) .arg(Arg::with_name("track-content") .long("content-hash") |