summaryrefslogtreecommitdiff
path: root/flags.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-04-30 20:52:41 +0200
committerxengineering <me@xengineering.eu>2024-05-01 10:32:34 +0200
commit01699e3c9339cd7880f632be088d770225b84d68 (patch)
tree17acd3d74f9352f3d665e7d0e6e1ae9e80d4d66d /flags.go
parent581feffe944a5eeb42f4cba3e4d24f0e1d5b0b3f (diff)
downloadceres-01699e3c9339cd7880f632be088d770225b84d68.tar
ceres-01699e3c9339cd7880f632be088d770225b84d68.tar.zst
ceres-01699e3c9339cd7880f632be088d770225b84d68.zip
Add --version flag
This allows to identify the version of a Ceres executable build.
Diffstat (limited to 'flags.go')
-rw-r--r--flags.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/flags.go b/flags.go
index e7ff85e..862cffa 100644
--- a/flags.go
+++ b/flags.go
@@ -7,15 +7,18 @@ import (
const help = `Ceres - Recipe server for local networks
-Usage: ceres [-h | --help]
+Usage: ceres [-h | --help] [-v | --version]
-h, --help show this help page and exit
+ -v, --version print version information
`
-func parseFlags() {
+var printVersion bool
+
+func init() {
+ flag.BoolVar(&printVersion, "version", false, "print version information")
+ flag.BoolVar(&printVersion, "v", false, "print version information")
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), help)
}
-
- flag.Parse()
}