diff options
-rw-r--r-- | commands/msg/reply.go | 21 | ||||
-rw-r--r-- | doc/aerc.1.scd | 5 |
2 files changed, 22 insertions, 4 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go index ebf20317..699c75fb 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -30,6 +30,7 @@ type reply struct { Template string `opt:"-T" complete:"CompleteTemplate"` Edit bool `opt:"-e"` NoEdit bool `opt:"-E"` + Account string `opt:"-A" complete:"CompleteAccount"` } func init() { @@ -44,14 +45,28 @@ func (*reply) CompleteTemplate(arg string) []string { return commands.GetTemplates(arg) } +func (*reply) CompleteAccount(arg string) []string { + return commands.FilterList(app.AccountNames(), arg, commands.QuoteSpace) +} + func (r reply) Execute(args []string) error { editHeaders := (config.Compose.EditHeaders || r.Edit) && !r.NoEdit widget := app.SelectedTabContent().(app.ProvidesMessage) - acct := widget.SelectedAccount() - if acct == nil { - return errors.New("No account selected") + var acct *app.AccountView + var err error + + if r.Account == "" { + acct = widget.SelectedAccount() + if acct == nil { + return errors.New("No account selected") + } + } else { + acct, err = app.Account(r.Account) + if err != nil { + return err + } } conf := acct.AccountConfig() diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd index 6214d02e..28f223bb 100644 --- a/doc/aerc.1.scd +++ b/doc/aerc.1.scd @@ -299,7 +299,7 @@ message list, the message in the message viewer, etc). _[PATCH X/Y]_), all marked messages will be sorted by subject to ensure that the patches are applied in order. -*:reply* [*-acq*] [*-T* _<template-file>_] [*-e*|*-E*] +*:reply* [*-acq*] [*-T* _<template-file>_] [*-A* _<account>_] [*-e*|*-E*] Opens the composer to reply to the selected message. *-a*: Reply all @@ -314,6 +314,9 @@ message list, the message in the message viewer, etc). message body. If *-q* is specified, defaults to what is set as *quoted-reply* in the *[templates]* section of _aerc.conf_. + *-A*_: _<account>_ + Reply with the specified account instead of the current one. + *-e*: Forces *[compose].edit-headers* = _true_ for this message only. *-E*: Forces *[compose].edit-headers* = _false_ for this message only. |