mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-03 11:53:43 +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() {
|
func main() {
|
||||||
|
|
||||||
var version bool
|
var version bool
|
||||||
|
var usage bool
|
||||||
var addr string;
|
var addr string;
|
||||||
|
|
||||||
logger = log.New()
|
logger = log.New()
|
||||||
|
|
||||||
// Command line parsing
|
// Command line parsing
|
||||||
|
getopt.FlagLong(&usage, "help", 'h', "Print this help text")
|
||||||
getopt.FlagLong(&version, "version", 'v', "Print version")
|
getopt.FlagLong(&version, "version", 'v', "Print version")
|
||||||
getopt.FlagLong(&logFile, "log", 'l', "Path to log file", "file")
|
getopt.FlagLong(&logFile, "log", 'l', "Path to log file", "file")
|
||||||
getopt.FlagLong(&pidFile, "pid", 'p', "Path to pid file", "file")
|
getopt.FlagLong(&pidFile, "pid", 'p', "Path to pid file", "file")
|
||||||
getopt.Parse()
|
getopt.Parse()
|
||||||
|
|
||||||
|
if usage {
|
||||||
|
getopt.Usage()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if version {
|
if version {
|
||||||
print("Version: v1.1\n")
|
print("Version: v1.1\n")
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue