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:
parent
44a01344c7
commit
15568153c9
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue