aboutsummaryrefslogtreecommitdiffstats
path: root/lib/state
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-05-30 11:30:17 +0200
committerRobin Jarry <robin@jarry.cc>2024-06-05 08:41:13 +0200
commit47c226687265ff29969fd73cdc69a938fae20d4c (patch)
treeca4e07dd81816a2725f2bf8f3ef9b727bbbf03bd /lib/state
parent74bba6745d2bf1120d143a9898c8a7204d9d20e9 (diff)
downloadaerc-47c226687265ff29969fd73cdc69a938fae20d4c.tar.gz
templates: add .AccountBackend
It's useful to know what the current account's backend is, especially if one has multiple configs where the same account name might use a different backend. Add AccountBackend to templates. Changelog-added: Added `{{.AccountBackend}}` to templates. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/state')
-rw-r--r--lib/state/templates.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/state/templates.go b/lib/state/templates.go
index 37767660..e5206cf0 100644
--- a/lib/state/templates.go
+++ b/lib/state/templates.go
@@ -160,6 +160,13 @@ func (d *templateData) Account() string {
return ""
}
+func (d *templateData) AccountBackend() string {
+ if d.account != nil {
+ return d.account.Backend
+ }
+ return ""
+}
+
func (d *templateData) Folder() string {
if d.folder != nil {
return d.folder.Name