From 445a9885cfcf096353f052dab8f943495ba5747a Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 2 Jan 2016 19:08:32 +0100 Subject: [PATCH] Notes: Implement command_rm_tags --- src/module/notes/mod.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/module/notes/mod.rs b/src/module/notes/mod.rs index 399f5778..f08722fb 100644 --- a/src/module/notes/mod.rs +++ b/src/module/notes/mod.rs @@ -149,7 +149,16 @@ impl<'a> Notes<'a> { } 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 {