diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-01-02 19:07:40 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-01-02 20:06:20 +0100 |
commit | e42d7f7f8d04248ef6bdca4443ebad1383ec6184 (patch) | |
tree | 201568807dd997ac0fa8ca2b7d8547fd0cd59410 /src/module/notes/mod.rs | |
parent | 1bccf067bfeb83e7004b5ff0ac792659e8aca25f (diff) |
Notes: Implement command_add_tags()
Diffstat (limited to 'src/module/notes/mod.rs')
-rw-r--r-- | src/module/notes/mod.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/module/notes/mod.rs b/src/module/notes/mod.rs index 69372ccf..399f5778 100644 --- a/src/module/notes/mod.rs +++ b/src/module/notes/mod.rs @@ -137,7 +137,15 @@ impl<'a> Notes<'a> { } fn command_add_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| { + let mut new_tags = old_tags.clone(); + new_tags.append(&mut cli_tags.clone()); + new_tags + }, rebuild_header_with_tags) } fn command_rm_tags(&self, matches: &ArgMatches) -> bool { |