Add BMModule::add() implementation

This commit is contained in:
Matthias Beyer 2015-11-10 17:38:02 +01:00
parent 0896f2093b
commit bfccbc32c5

View file

@ -9,6 +9,10 @@ use regex::Regex;
mod header;
use self::header::build_header;
use storage::json::parser::JsonHeaderParser;
use storage::parser::FileHeaderParser;
pub struct BMModule {
path: Option<String>,
}
@ -63,6 +67,10 @@ fn add<'a>(rt: &Runtime, sub: &ArgMatches<'a, 'a>) -> ModuleResult {
let tags = get_tags(rt, sub);
info!("Adding url '{}' with tags '{:?}'", url, tags);
let header = build_header(&String::from(url), &tags);
let jheader = JsonHeaderParser::new(None).write(&header);
println!("JSON: {:?}", jheader);
Ok(())
}