Introduce tui.Version (defaults to "dev"), stamped at build time via a VERSION_LDFLAG in the Makefile (-X .../internal/tui.Version=$(VERSION)) across all build targets. main.go handles "--version"/"-v" before launching the TUI, and the version is shown next to the title in the header. Docs updated (README + CLAUDE). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
420 B
Go
26 lines
420 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
tea "charm.land/bubbletea/v2"
|
|
"git.davinti.com.br/davinTI/app-dono/tui/internal/tui"
|
|
)
|
|
|
|
func main() {
|
|
if len(os.Args) > 1 {
|
|
switch os.Args[1] {
|
|
case "--version", "-v":
|
|
fmt.Println("app-dono installer", tui.Version)
|
|
return
|
|
}
|
|
}
|
|
|
|
p := tea.NewProgram(tui.InitialModel())
|
|
if _, err := p.Run(); err != nil {
|
|
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|