1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-18 05:00:03 +02:00

src/main.go: Add --help|-h flag to getopt

This commit is contained in:
Henrik Hautakoski 2022-01-04 09:45:02 +01:00
parent 44a01344c7
commit 15568153c9
No known key found for this signature in database
GPG key ID: 608414D93E862CCD

View file

@ -111,16 +111,23 @@ func signalEventLoop() {
func main() {
var version bool
var usage bool
var addr string;
logger = log.New()
// Command line parsing
getopt.FlagLong(&usage, "help", 'h', "Print this help text")
getopt.FlagLong(&version, "version", 'v', "Print version")
getopt.FlagLong(&logFile, "log", 'l', "Path to log file", "file")
getopt.FlagLong(&pidFile, "pid", 'p', "Path to pid file", "file")
getopt.Parse()
if usage {
getopt.Usage()
return
}
if version {
print("Version: v1.1\n")
return;