summaryrefslogtreecommitdiffstats
path: root/ui/src/execute.rs
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-12-01 17:12:41 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-12-07 17:31:49 +0200
commitc6f1fa9be03616a66d3fadc1fdd439125c0b4702 (patch)
treea74c10c806d6ca5c04c155923c1703794ba35b78 /ui/src/execute.rs
parentdab9b39f4d36b91503c400a624d207dbc7f6939f (diff)
ui: Add TagAction
Add/Remove
Diffstat (limited to 'ui/src/execute.rs')
-rw-r--r--ui/src/execute.rs26
1 files changed, 24 insertions, 2 deletions
diff --git a/ui/src/execute.rs b/ui/src/execute.rs
index 6387a32e..2d50686a 100644
--- a/ui/src/execute.rs
+++ b/ui/src/execute.rs
@@ -33,6 +33,7 @@ pub use crate::actions::ComposeAction::{self, *};
pub use crate::actions::ListingAction::{self, *};
pub use crate::actions::MailingListAction::{self, *};
pub use crate::actions::TabAction::{self, *};
+pub use crate::actions::TagAction::{self, *};
pub use crate::actions::ViewAction::{self, *};
use std::str::FromStr;
@@ -333,7 +334,28 @@ define_commands!([
)
);
)
- }
+ },
+ { tags: ["tag", "tag add", "tag remove"],
+ desc: "tag [add/remove], edits message's tags.",
+ parser:
+ ( named!(
+ tag<Action>,
+ preceded!(
+ ws!(tag!("tag")),
+ alt_complete!(
+ do_parse!(
+ ws!(tag!("add"))
+ >> tag: ws!(map_res!(call!(not_line_ending), std::str::from_utf8))
+ >> (Listing(Tag(Add(tag.to_string())))))
+ | do_parse!(
+ ws!(tag!("remove"))
+ >> tag: ws!(map_res!(call!(not_line_ending), std::str::from_utf8))
+ >> (Listing(Tag(Remove(tag.to_string())))))
+
+ )
+ )
+ ); )
+ }
]);
named!(
@@ -382,7 +404,7 @@ named!(
named!(
listing_action<Action>,
- alt_complete!(toggle | envelope_action | filter | toggle_thread_snooze | open_in_new_tab)
+ alt_complete!(toggle | envelope_action | filter | toggle_thread_snooze | open_in_new_tab | tag)
);
named!(