Skip to content

Commit 05b8621

Browse files
committed
Fix command line flags
1 parent 005c9be commit 05b8621

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func help() {
4040

4141
func parseFlags() {
4242
lenArgs := len(os.Args)
43-
if (lenArgs != 1 && lenArgs % 2 == 0) || os.Args[1] == "-help" || os.Args[1] == "-h" {
43+
if lenArgs != 1 && lenArgs % 2 == 0 {
4444
help()
4545
}
4646

@@ -57,6 +57,11 @@ func parseFlags() {
5757
}
5858

5959
key := strings.ToLower(val[1:])
60+
61+
if key == "h" || key == "help" {
62+
help()
63+
}
64+
6065
arg := os.Args[i + 1]
6166

6267
if key == "addr" {

0 commit comments

Comments
 (0)