aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-22 11:17:52 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-22 11:17:52 -0400
commit1a45b793c7d1d59e209be3eb4b4f794a78085e5d (patch)
tree903898f4d0299adf3edcf653fc71c44fba0efef9 /commands
parent58bc15b4727c034f9ce656f7774d68ec2e7a3f55 (diff)
Implement :help
Diffstat (limited to 'commands')
-rw-r--r--commands/help.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/commands/help.go b/commands/help.go
new file mode 100644
index 0000000..e269fcf
--- /dev/null
+++ b/commands/help.go
@@ -0,0 +1,21 @@
+package commands
+
+import (
+ "errors"
+
+ "git.sr.ht/~sircmpwn/aerc/widgets"
+)
+
+func init() {
+ register("help", Help)
+}
+
+func Help(aerc *widgets.Aerc, args []string) error {
+ page := "aerc"
+ if len(args) == 2 {
+ page = "aerc-" + args[1]
+ } else if len(args) > 2 {
+ return errors.New("Usage: help [topic]")
+ }
+ return Term(aerc, []string{"term", "man", page})
+}