summaryrefslogtreecommitdiffstats
path: root/imag-bookmark
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-10-07 19:45:49 +0200
committerGitHub <noreply@github.com>2016-10-07 19:45:49 +0200
commit30875d153f7320457f80e78830646d74f6f9f9e2 (patch)
tree4693b7377d6f8cf83f3391df03118158017e9335 /imag-bookmark
parent7611ad28929209b79b6c219f073705ed34901dfd (diff)
parentd506e869ca62e740c6895d72decf70db719b634d (diff)
Merge pull request #771 from matthiasbeyer/clap-validators
Clap validators
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 76b883de..0b142574 100644
--- a/imag-bookmark/src/ui.rs
+++ b/imag-bookmark/src/ui.rs
@@ -20,6 +20,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
@@ -41,6 +42,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())
)
@@ -63,6 +65,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"))
)