diff options
author | xengineering <me@xengineering.eu> | 2024-04-30 20:52:41 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-05-01 10:32:34 +0200 |
commit | 01699e3c9339cd7880f632be088d770225b84d68 (patch) | |
tree | 17acd3d74f9352f3d665e7d0e6e1ae9e80d4d66d /flags.go | |
parent | 581feffe944a5eeb42f4cba3e4d24f0e1d5b0b3f (diff) | |
download | ceres-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.go | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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() } |