Skip to content

Commit 07d7109

Browse files
authored
Add application version to help screen (#12)
Retrieve build version using `runtime/debug` and display it in the help section. This provides users with clearer version context directly within the UI.
1 parent a7c9229 commit 07d7109

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

internal/ui/keybindings.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package ui
22

33
import (
44
"fmt"
5+
"runtime/debug"
56
"strings"
67

78
tea "github.com/charmbracelet/bubbletea"
@@ -172,7 +173,15 @@ func (kb KeyBindings) GenerateHelpContent(overlayWidth int) string {
172173
columnWidth := (contentWidth / 2) - 2 // 2 for spacing between columns
173174

174175
// Build the content with two columns
175-
content := HelpTextTitleStyle.Render("Help - Available Commands") + "\n\n"
176+
content := HelpTextTitleStyle.Render("Help - Available Commands")
177+
178+
bi, ok := debug.ReadBuildInfo()
179+
if ok {
180+
version := bi.Main.Version
181+
content += HelpStyle.Render("\n" + version)
182+
}
183+
184+
content += "\n\n"
176185

177186
// Add each section
178187
for _, section := range kb.Sections {

0 commit comments

Comments
 (0)