Merge branch 'add-url-check'

This commit is contained in:
Matthias Beyer 2015-12-04 15:09:14 +01:00
commit 702f1b07ad
2 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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);