- go.mod (1.24.2 + initial bubbletea/lipgloss) - Makefile (build, install to ~/.local/bin/gralculator, test, clean; ldflags version injection) - internal/version (ldflags-compatible String()) - main.go stub (version flag + placeholder) - internal/calc/ (Engine skeleton with Base, CycleBase, IsInteger, ErrConversionNotPossible, FormatForDisplay stub + basic tests for CERR path) - internal/ui/ (App model stub with Tab handling placeholder + lipgloss import for future rendering) This establishes the three-phase foundation. Next: flesh out engine (phase 2), then TUI spike (phase 3). Paper trail continues.
33 lines
641 B
Go
33 lines
641 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/gmgauthier/gralculator/internal/version"
|
|
)
|
|
|
|
var versionFlag bool
|
|
|
|
func init() {
|
|
flag.BoolVar(&versionFlag, "v", false, "print version and exit")
|
|
flag.BoolVar(&versionFlag, "version", false, "print version and exit")
|
|
}
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
if versionFlag {
|
|
fmt.Println(version.String())
|
|
return
|
|
}
|
|
|
|
// TODO (phase 3): wire up tea.NewProgram with ui model
|
|
fmt.Println("gralculator (skeleton)")
|
|
fmt.Println("Version:", version.String())
|
|
fmt.Println("Tab will eventually cycle bases (DEC/HEX/BIN/OCT).")
|
|
fmt.Println("See docs/ and spec.md for design.")
|
|
os.Exit(0)
|
|
}
|