Add build script, generate version string on build time, modify usage and add version info

This commit is contained in:
ChaoticByte 2024-07-02 17:20:07 +02:00
parent 8538df7a14
commit 9364b82e08
No known key found for this signature in database
4 changed files with 23 additions and 1 deletions

10
args.go
View file

@ -5,6 +5,7 @@ package main
import (
"flag"
"fmt"
)
var configFilepath string
@ -12,6 +13,15 @@ var privateKeyFilepath string
var logFlag bool
func ParseCommandline() bool {
flag.Usage = func () {
fmt.Println(`Usage: ass -config <string> -pkey <string> [-log]
-config <string> The path to the config file (required)
-pkey <string> The path to the private key file (required)
-log Enable logging of messages
version:`, Version)
}
flag.StringVar(&configFilepath, "config", "", "The path to the config file (required)")
flag.StringVar(&privateKeyFilepath, "pkey", "", "The path to the private key file (required)")
flag.BoolVar(&logFlag, "log", false, "Enable logging of messages")