diff options
Diffstat (limited to 'src/command.rs')
-rw-r--r-- | src/command.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/command.rs b/src/command.rs index c83008bf..562b1a5d 100644 --- a/src/command.rs +++ b/src/command.rs @@ -500,6 +500,20 @@ define_commands!([ } ) }, + { tags: ["mailto "], + desc: "mailto MAILTO_ADDRESS", + tokens: &[One(Literal("mailto")), One(QuotedStringValue)], + parser:( + fn mailto(input: &[u8]) -> IResult<&[u8], Action> { + let (input, _) = tag("mailto")(input.ltrim())?; + let (input, _) = is_a(" ")(input)?; + let (input, val) = map_res(not_line_ending, std::str::from_utf8)(input.trim())?; + let (_empty, _) = eof(input)?; + let (input, val) = melib::email::parser::generic::mailto(val.as_bytes()).map_err(|err| err.map(Into::into))?; + Ok((input, Compose(Mailto(val)))) + } + ) + }, /* Pipe pager contents to binary */ { tags: ["pipe "], desc: "pipe EXECUTABLE ARGS", @@ -931,6 +945,7 @@ fn listing_action(input: &[u8]) -> IResult<&[u8], Action> { fn compose_action(input: &[u8]) -> IResult<&[u8], Action> { alt(( add_attachment, + mailto, remove_attachment, toggle_sign, toggle_encrypt, |