Add BMModule::add() implementation
This commit is contained in:
parent
0896f2093b
commit
bfccbc32c5
1 changed files with 8 additions and 0 deletions
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue