Notes: Implement command_rm_tags

This commit is contained in:
Matthias Beyer 2016-01-02 19:08:32 +01:00
parent e42d7f7f8d
commit 445a9885cf

View file

@ -149,7 +149,16 @@ impl<'a> Notes<'a> {
} }
fn command_rm_tags(&self, matches: &ArgMatches) -> bool { fn command_rm_tags(&self, matches: &ArgMatches) -> bool {
unimplemented!() use module::helpers::header::tags::data::alter_tags_in_files;
use self::header::rebuild_header_with_tags;
let parser = Parser::new(JsonHeaderParser::new(None));
alter_tags_in_files(self, matches, &parser, |old_tags, cli_tags| {
old_tags.clone()
.into_iter()
.filter(|tag| !cli_tags.contains(tag))
.collect()
}, rebuild_header_with_tags)
} }
fn command_set_tags(&self, matches: &ArgMatches) -> bool { fn command_set_tags(&self, matches: &ArgMatches) -> bool {