diff options
Diffstat (limited to 'commands/term.go')
-rw-r--r-- | commands/term.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/commands/term.go b/commands/term.go index 3f70d67..8575019 100644 --- a/commands/term.go +++ b/commands/term.go @@ -10,11 +10,22 @@ import ( "github.com/riywo/loginshell" ) +type Term struct{} + func init() { - register("term", Term) + register(Term{}) +} + +func (_ Term) Aliases() []string { + return []string{"terminal", "term"} +} + +func (_ Term) Complete(aerc *widgets.Aerc, args []string) []string { + return nil } -func Term(aerc *widgets.Aerc, args []string) error { +// The help command is an alias for `term man` thus Term requires a simple func +func TermCore(aerc *widgets.Aerc, args []string) error { if len(args) == 1 { shell, err := loginshell.Shell() if err != nil { @@ -43,3 +54,7 @@ func Term(aerc *widgets.Aerc, args []string) error { } return nil } + +func (_ Term) Execute(aerc *widgets.Aerc, args []string) error { + return TermCore(aerc, args) +} |