Add build script, generate version string on build time, modify usage and add version info
This commit is contained in:
parent
8538df7a14
commit
9364b82e08
4 changed files with 23 additions and 1 deletions
10
args.go
10
args.go
|
@ -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")
|
||||
|
|
Reference in a new issue