mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Add version flag to display llamactl version
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// version is set at build time using -ldflags "-X main.version=1.0.0"
|
||||
var version string = "unknown"
|
||||
|
||||
// @title llamactl API
|
||||
// @version 1.0
|
||||
// @description llamactl is a control server for managing Llama Server instances.
|
||||
@@ -19,6 +22,12 @@ import (
|
||||
// @basePath /api/v1
|
||||
func main() {
|
||||
|
||||
// --version flag to print the version
|
||||
if len(os.Args) > 1 && os.Args[1] == "--version" {
|
||||
fmt.Printf("llamactl version: %s\n", version)
|
||||
return
|
||||
}
|
||||
|
||||
configPath := os.Getenv("LLAMACTL_CONFIG_PATH")
|
||||
cfg, err := config.LoadConfig(configPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user