diff --git a/Makefile b/Makefile index 586aa8c..cbaafe0 100755 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir} SYSDDIR=${SYSDDIR_:/%=%} DESTDIR=/ -LDFLAGS=-ldflags "-s -w" +LDFLAGS=-ldflags "-s -w -X main.version=22.31.0" all: ${TARGET} diff --git a/cmd/dwelling-radio/main.go b/cmd/dwelling-radio/main.go index ed09566..7445915 100644 --- a/cmd/dwelling-radio/main.go +++ b/cmd/dwelling-radio/main.go @@ -14,6 +14,8 @@ import ( "syscall" ) +var version string + var configPath *string = flag.String("conf", "config.yaml", "path to configuration file") var logToStdout *bool = flag.Bool("log-stdout", false, "write logs to stdout") var showVersion *bool = flag.Bool("v", false, "show version") @@ -22,7 +24,7 @@ func main() { flag.Parse() if *showVersion { - fmt.Println("dwelling-radio Ver. 22.24.1\nCopyright (c) 2022 Alexander \"Arav\" Andreev ") + fmt.Println("dwelling-radio Ver.", version, "\nCopyright (c) 2022 Alexander \"Arav\" Andreev ") return }