diff --git a/src/main.rs b/src/main.rs index 62834703..ea9332fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,7 @@ #[macro_use] extern crate uuid; #[macro_use] extern crate regex; #[macro_use] extern crate prettytable; +extern crate url; extern crate config; use cli::CliConfig; diff --git a/src/module/bm/commands.rs b/src/module/bm/commands.rs index 43200b0f..9424f5d2 100644 --- a/src/module/bm/commands.rs +++ b/src/module/bm/commands.rs @@ -18,7 +18,16 @@ use clap::ArgMatches; use regex::Regex; pub fn add_command(module: &Module, env: CommandEnv) -> CommandResult { + use url::Url; + let url = env.matches.value_of("url").unwrap(); + + if let Err(e) = Url::parse(url) { + info!("Not an URL: '{}'", url); + info!(" this will turn into an hard error before 0.1.0"); + debug!("URL parsing error: {:?}", e); + } + let tags = get_tags(env.rt, env.matches); info!("Adding url '{}' with tags '{:?}'", url, tags);