From 3ba69edab5f0c787424dac9649e43a7743da13ca Mon Sep 17 00:00:00 2001 From: Srivathsan Murali Date: Sun, 3 Nov 2019 13:51:14 +0100 Subject: Add Templates with Parsing + Changes NewComposer to return error. + Add lib to handle templates using "text/template". + Add -T option to following commands - compose. - reply - forward + Quoted replies using templates. + Forwards as body using templates + Default templates are installed similar to filters. + Templates Config in aerc.conf. - Required templates are parsed while loading config. + Add aerc-templates.7 manual for using template data. --- commands/msg/reply.go | 73 ++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 38 deletions(-) (limited to 'commands/msg/reply.go') diff --git a/commands/msg/reply.go b/commands/msg/reply.go index 9ef7a3b..b13e254 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -1,7 +1,7 @@ package msg import ( - "bufio" + "bytes" "errors" "fmt" "io" @@ -32,16 +32,17 @@ func (reply) Complete(aerc *widgets.Aerc, args []string) []string { } func (reply) Execute(aerc *widgets.Aerc, args []string) error { - opts, optind, err := getopt.Getopts(args, "aq") + opts, optind, err := getopt.Getopts(args, "aqT:") if err != nil { return err } if optind != len(args) { - return errors.New("Usage: reply [-aq]") + return errors.New("Usage: reply [-aq -T