imag-bookmark: Validate URLs

This commit is contained in:
Matthias Beyer 2016-09-28 19:44:23 +02:00
parent 11490b232c
commit 6999f95c4d

View file

@ -1,6 +1,7 @@
use clap::{Arg, App, SubCommand}; use clap::{Arg, App, SubCommand};
use libimagentrytag::ui::tag_add_arg; use libimagentrytag::ui::tag_add_arg;
use libimagutil::cli_validators::*;
pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
app app
@ -22,6 +23,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.required(true) .required(true)
.multiple(true) .multiple(true)
.value_name("URL") .value_name("URL")
.validator(is_url)
.help("Add this URL, multiple possible")) .help("Add this URL, multiple possible"))
.arg(tag_add_arg()) .arg(tag_add_arg())
) )
@ -44,6 +46,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.required(true) .required(true)
.multiple(true) .multiple(true)
.value_name("URL") .value_name("URL")
.validator(is_url)
.help("Remove these urls, regex supported")) .help("Remove these urls, regex supported"))
) )