summaryrefslogtreecommitdiffstats
path: root/imag-bookmark
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-09-28 19:44:23 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-09-28 19:44:23 +0200
commit6999f95c4d7653b9c44960a9cb54b8675f428269 (patch)
tree976de132dd905747f29b0cf14159810eeb3272ab /imag-bookmark
parent11490b232c71e3ee03d8f8c424902465fb3f7ae3 (diff)
imag-bookmark: Validate URLs
Diffstat (limited to 'imag-bookmark')
-rw-r--r--imag-bookmark/src/ui.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/imag-bookmark/src/ui.rs b/imag-bookmark/src/ui.rs
index 701cdbba..6c49ba72 100644
--- a/imag-bookmark/src/ui.rs
+++ b/imag-bookmark/src/ui.rs
@@ -1,6 +1,7 @@
use clap::{Arg, App, SubCommand};
use libimagentrytag::ui::tag_add_arg;
+use libimagutil::cli_validators::*;
pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
app
@@ -22,6 +23,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.required(true)
.multiple(true)
.value_name("URL")
+ .validator(is_url)
.help("Add this URL, multiple possible"))
.arg(tag_add_arg())
)
@@ -44,6 +46,7 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> {
.required(true)
.multiple(true)
.value_name("URL")
+ .validator(is_url)
.help("Remove these urls, regex supported"))
)