mirror of
https://gitlab.com/pnx-tools/dns-updater.git
synced 2026-06-16 05:54:56 +02:00
cmd/dnsupdater/main.go: print version
This commit is contained in:
parent
961f3951a8
commit
d3fea6ec4b
1 changed files with 9 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
|
|
@ -11,11 +12,19 @@ import (
|
|||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
var version string = "(unknown)"
|
||||
|
||||
func main() {
|
||||
configFile := flag.String("config", "./config.yml", "configuration file")
|
||||
versionFlag := flag.Bool("v", false, "Prints the version")
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if *versionFlag {
|
||||
fmt.Println(version)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{
|
||||
Out: os.Stderr,
|
||||
TimeFormat: time.RFC3339,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue