1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2025-02-22 14:53:57 +01:00
aerc/commands/version.go
inwit 7712a212bf commands: add version command
Sometimes it might be useful to know the version of the running
instance. This is currently possible with templates (`:echo {{version}}`
does the trick), but it seems clearer to have a dedicated command.
Implement such command.

Changelog-added: New `:version` command shows the version of the
 running instance of aerc in the statusbar.
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
2025-02-20 23:09:47 +01:00

32 lines
528 B
Go

package commands
import (
"fmt"
"time"
"git.sr.ht/~rjarry/aerc/app"
"git.sr.ht/~rjarry/aerc/lib/log"
)
type Version struct{}
func init() {
Register(Version{})
}
func (Version) Description() string {
return "Display the version of the running aerc instance."
}
func (Version) Context() CommandContext {
return GLOBAL
}
func (Version) Aliases() []string {
return []string{"version"}
}
func (p Version) Execute(args []string) error {
app.PushStatus(fmt.Sprint("aerc "+log.BuildInfo), 20*time.Second)
return nil
}