diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/terminal/close.go (renamed from commands/term-close.go) | 7 | ||||
-rw-r--r-- | commands/terminal/terminal.go | 16 |
2 files changed, 19 insertions, 4 deletions
diff --git a/commands/term-close.go b/commands/terminal/close.go index 7da4f42..68be6ac 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 0000000..f438582 --- /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) +} |