mirror of
https://git.sr.ht/~rjarry/aerc
synced 2025-02-22 14:53:57 +01:00

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>
32 lines
528 B
Go
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
|
|
}
|