commit e2c6f15e5b2f9179b02fae294d35800da70a192c
parent 10da72a1f647c83d6abb438ae9c544ffacc8baea
Author: vx-clutch <[email protected]>
Date: Tue, 16 Dec 2025 18:41:38 -0500
start beta versioning
Diffstat:
3 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/main.go b/main.go
@@ -13,6 +13,7 @@ import (
"fes/src/doc"
"fes/src/new"
"fes/src/server"
+ "fes/src/version"
)
//go:embed core/*
@@ -38,8 +39,14 @@ func main() {
fmt.Println("Options:")
flag.PrintDefaults()
}
+
+ showVersion := flag.Bool("version", false, "Show version and exit")
flag.Parse()
+ if *showVersion {
+ version.Version()
+ }
+
if *config.Color {
color.NoColor = true
}
diff --git a/src/ui/ui.go b/src/ui/ui.go
@@ -2,10 +2,12 @@ package ui
import (
"errors"
- "fes/src/config"
"fmt"
"strings"
+ "fes/src/config"
+ "fes/src/version"
+
"github.com/fatih/color"
)
@@ -28,17 +30,17 @@ func Path(path string, err error) {
}
func Warning(msg string, err error) error {
- fmt.Printf("fes: %s: %v\n", color.MagentaString("warning"), err)
+ fmt.Printf("%s: %s: %v\n", version.PROGRAM_NAME, color.MagentaString("warning"), err)
return err
}
func Error(msg string, err error) error {
- fmt.Printf("fes: %s: %v\n", color.RedString("error"), err)
+ fmt.Printf("%s: %s: %v\n", version.PROGRAM_NAME, color.RedString("error"), err)
return err
}
func Fatal(msg string, err error) error {
- fmt.Printf("fes: %s: %v\n", color.RedString("fatal"), err)
+ fmt.Printf("%s: %s: %v\n", version.PROGRAM_NAME, color.RedString("fatal"), err)
panic(err)
}
diff --git a/src/version/version.go b/src/version/version.go
@@ -0,0 +1,15 @@
+package version
+
+import (
+ "fmt"
+ "os"
+)
+
+const PROGRAM_NAME string = "fes"
+const PROGRAM_NAME_LONG string = "fes/fSD"
+const VERSION string = "beta"
+
+func Version() {
+ fmt.Printf("%s version %s\n", PROGRAM_NAME_LONG, VERSION)
+ os.Exit(0)
+}