diff --git a/Makefile b/Makefile index e2b633b..4c43d8d 100755 --- a/Makefile +++ b/Makefile @@ -1,11 +1,10 @@ TARGET=dwelling-files -SYSCTL=${shell which systemctl} SYSDDIR_=${shell pkg-config systemd --variable=systemdsystemunitdir} SYSDDIR=${SYSDDIR_:/%=%} DESTDIR=/ -LDFLAGS=-ldflags "-s -w" -tags osusergo,netgo +LDFLAGS=-ldflags "-s -w -X main.version=22.31.0" -tags osusergo,netgo all: ${TARGET} diff --git a/cmd/dwelling-files/main.go b/cmd/dwelling-files/main.go index d281881..dddd0e6 100644 --- a/cmd/dwelling-files/main.go +++ b/cmd/dwelling-files/main.go @@ -14,6 +14,8 @@ import ( "syscall" ) +var version string + var listenAddress *string = flag.String("listen", "/var/run/dwelling-files/f.sock", "listen address (ip:port|unix_path)") var directoryPath *string = flag.String("path", "/srv/ftp", "path to file share") var disableFileHandler *bool = flag.Bool("no-file-handling", false, "disable file handling if it is handled by something else (e.g. NGiNX)") @@ -24,7 +26,7 @@ func main() { log.SetFlags(0) if *showVersion { - fmt.Println("dwelling-files ver. 22.27.0\nCopyright (c) 2022 Alexander \"Arav\" Andreev ") + fmt.Println("dwelling-files ver.", version, "\nCopyright (c) 2022 Alexander \"Arav\" Andreev ") return }