From 6c853bbaaa6e7ce8b6d9c54047d58146a7de888b Mon Sep 17 00:00:00 2001 From: Gnarwhal Date: Wed, 2 Oct 2024 02:51:32 +0000 Subject: [PATCH] Added version --- cmd/server/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/server/main.go b/cmd/server/main.go index 1530c09..50e570c 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -21,6 +21,7 @@ package main import ( "log" "flag" + "fmt" "crypto/tls" "forge.monodon.me/Gnarwhal/diodemail/smtp" @@ -28,8 +29,14 @@ import ( func main() { var cert_path string + var version bool flag.StringVar(&cert_path, "config", "/etc/diodemail/config.json", "Path to config file") + flag.BoolVar(&version, "version", false, "Print version") flag.Parse() + if version { + fmt.Println("diodemail version 1.0.0") + return + } config, err := LoadConfig(cert_path) if err != nil { log.Fatal(err)