summaryrefslogtreecommitdiff
path: root/commands/help.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/help.go')
-rw-r--r--commands/help.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/commands/help.go b/commands/help.go
index 5bc8f0e..6efaf4d 100644
--- a/commands/help.go
+++ b/commands/help.go
@@ -8,6 +8,19 @@ import (
type Help struct{}
+var pages = []string{
+ "aerc",
+ "config",
+ "imap",
+ "notmuch",
+ "search",
+ "sendmail",
+ "smtp",
+ "stylesets",
+ "templates",
+ "tutorial",
+}
+
func init() {
register(Help{})
}
@@ -17,12 +30,12 @@ func (Help) Aliases() []string {
}
func (Help) Complete(aerc *widgets.Aerc, args []string) []string {
- return nil
+ return CompletionFromList(aerc, pages, args)
}
func (Help) Execute(aerc *widgets.Aerc, args []string) error {
page := "aerc"
- if len(args) == 2 {
+ if len(args) == 2 && args[1] != "aerc" {
page = "aerc-" + args[1]
} else if len(args) > 2 {
return errors.New("Usage: help [topic]")