mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 09:04:27 +00:00
Add version flag to display llamactl version
This commit is contained in:
@@ -11,6 +11,9 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// version is set at build time using -ldflags "-X main.version=1.0.0"
|
||||||
|
var version string = "unknown"
|
||||||
|
|
||||||
// @title llamactl API
|
// @title llamactl API
|
||||||
// @version 1.0
|
// @version 1.0
|
||||||
// @description llamactl is a control server for managing Llama Server instances.
|
// @description llamactl is a control server for managing Llama Server instances.
|
||||||
@@ -19,6 +22,12 @@ import (
|
|||||||
// @basePath /api/v1
|
// @basePath /api/v1
|
||||||
func main() {
|
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")
|
configPath := os.Getenv("LLAMACTL_CONFIG_PATH")
|
||||||
cfg, err := config.LoadConfig(configPath)
|
cfg, err := config.LoadConfig(configPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user