aerc/commands/compose/cc-bcc.go

39 lines
608 B
Go
Raw Normal View History

2019-08-01 18:29:21 +00:00
package compose
import (
"strings"
"git.sr.ht/~rjarry/aerc/widgets"
2019-08-01 18:29:21 +00:00
)
type CC struct{}
func init() {
register(CC{})
}
func (CC) Aliases() []string {
2019-08-01 18:29:21 +00:00
return []string{"cc", "bcc"}
}
func (CC) Complete(aerc *widgets.Aerc, args []string) []string {
2019-08-01 18:29:21 +00:00
return nil
}
func (CC) Execute(aerc *widgets.Aerc, args []string) error {
var addrs string
if len(args) > 1 {
addrs = strings.Join(args[1:], " ")
2019-08-01 18:29:21 +00:00
}
composer, _ := aerc.SelectedTab().(*widgets.Composer)
switch args[0] {
case "cc":
composer.AddEditor("Cc", addrs, true)
2019-08-01 18:29:21 +00:00
case "bcc":
composer.AddEditor("Bcc", addrs, true)
2019-08-01 18:29:21 +00:00
}
return nil
}