~rjarry/aerc-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH aerc v1] commands/version: show running instance's version

Details
Message ID
<20250219191217.4049502-2-inwit@sindominio.net>
Sender timestamp
1739995931
DKIM signature
pass
Download raw message
Patch: +35 -0
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.

Signed-off-by: inwit <inwit@sindominio.net>
---
 commands/version.go | 32 ++++++++++++++++++++++++++++++++
 doc/aerc.1.scd      |  3 +++
 2 files changed, 35 insertions(+)
 create mode 100644 commands/version.go

diff --git a/commands/version.go b/commands/version.go
new file mode 100644
index 00000000..fb177120
--- /dev/null
+++ b/commands/version.go
@@ -0,0 +1,32 @@
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
}
diff --git a/doc/aerc.1.scd b/doc/aerc.1.scd
index 595a94af..b01dee75 100644
--- a/doc/aerc.1.scd
+++ b/doc/aerc.1.scd
@@ -171,6 +171,9 @@ These commands work in any context.
*:pwd*
	Displays aerc's current working directory in the status bar.

*:version*
	Displays the version of the running aerc instance.

*:send-keys* _<keystrokes>_
	Send keystrokes to the currently visible terminal, if any. Can be used to
	control embedded editors to save drafts or quit in a safe manner.
-- 
2.47.2
Reply to thread Export thread (mbox)