From 1a45b793c7d1d59e209be3eb4b4f794a78085e5d Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 22 May 2019 11:17:52 -0400 Subject: Implement :help --- commands/help.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 commands/help.go 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}) +} -- cgit 1.4.1-2-gfad0