aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/echo.go26
-rw-r--r--doc/aerc.1.scd3
2 files changed, 29 insertions, 0 deletions
diff --git a/commands/echo.go b/commands/echo.go
new file mode 100644
index 00000000..ebe997da
--- /dev/null
+++ b/commands/echo.go
@@ -0,0 +1,26 @@
+package commands
+
+import (
+ "git.sr.ht/~rjarry/aerc/app"
+)
+
+type Echo struct {
+ Template string `opt:"..." required:"false"`
+}
+
+func init() {
+ Register(Echo{})
+}
+
+func (Echo) Aliases() []string {
+ return []string{"echo"}
+}
+
+func (Echo) Context() CommandContext {
+ return GLOBAL
+}
+
+func (e Echo) Execute(args []string) error {
+ app.PushSuccess(e.Template)
+ return nil
+}
diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd
index 9d1d3302..b9c5af65 100644
--- a/doc/aerc.1.scd
+++ b/doc/aerc.1.scd
@@ -158,6 +158,9 @@ These commands work in any context.
Note: commands executed in this way are not executed with the shell.
+*:echo* _<string>_
+ Resolve templates in _<string>_ and print it.
+
*:eml* [_<path>_]++
*:preview* [_<path>_]
Opens an eml file and displays the message in the message viewer.