aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-21 16:32:22 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-21 16:32:22 -0400
commit10dd23f05d271a27ad40a6fafffb5fe2c3e5fe57 (patch)
treea2fe85d9e0de5a972bfa7705558e7d50e95445c3 /commands
parent8126d82956636a2525263e2d0d985d721fdb8074 (diff)
downloadaerc-10dd23f05d271a27ad40a6fafffb5fe2c3e5fe57.tar.gz
Add terminal command context
Diffstat (limited to 'commands')
-rw-r--r--commands/terminal/close.go (renamed from commands/term-close.go)7
-rw-r--r--commands/terminal/terminal.go16
2 files changed, 19 insertions, 4 deletions
diff --git a/commands/term-close.go b/commands/terminal/close.go
index 7da4f426..68be6ac5 100644
--- a/commands/term-close.go
+++ b/commands/terminal/close.go
@@ -1,4 +1,4 @@
-package commands
+package terminal
import (
"errors"
@@ -7,11 +7,10 @@ import (
)
func init() {
- // TODO: Move this command into a terminal-specific command set
- register("close", TermClose)
+ register("close", CommandClose)
}
-func TermClose(aerc *widgets.Aerc, args []string) error {
+func CommandClose(aerc *widgets.Aerc, args []string) error {
if len(args) != 1 {
return errors.New("Usage: close")
}
diff --git a/commands/terminal/terminal.go b/commands/terminal/terminal.go
new file mode 100644
index 00000000..f438582f
--- /dev/null
+++ b/commands/terminal/terminal.go
@@ -0,0 +1,16 @@
+package terminal
+
+import (
+ "git.sr.ht/~sircmpwn/aerc2/commands"
+)
+
+var (
+ TerminalCommands *commands.Commands
+)
+
+func register(name string, cmd commands.AercCommand) {
+ if TerminalCommands == nil {
+ TerminalCommands = commands.NewCommands()
+ }
+ TerminalCommands.Register(name, cmd)
+}