imag-bookmark: Validate URLs
This commit is contained in:
parent
11490b232c
commit
6999f95c4d
1 changed files with 3 additions and 0 deletions
|
@ -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"))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue