Skip to content

Commit

Permalink
add -v and --version
Browse files Browse the repository at this point in the history
  • Loading branch information
ameshkov committed Aug 27, 2020
1 parent 5a72622 commit 05324f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ func main() {

if !machineReadable {
os.Stdout.WriteString(fmt.Sprintf("dnslookup %s\n", VersionString))

if len(os.Args) == 2 && (os.Args[1] == "-v" || os.Args[1] == "--version") {
os.Exit(0)
}
}

if insecureSkipVerify {
os.Stdout.WriteString("TLS verification has been disabled\n")
}

if len(os.Args) == 1 && os.Args[0] == "-h" {
if len(os.Args) == 2 && (os.Args[1] == "-h" || os.Args[1] == "--help") {
usage()
os.Exit(1)
os.Exit(0)
}

if len(os.Args) != 3 && len(os.Args) != 4 && len(os.Args) != 5 {
Expand Down

0 comments on commit 05324f3

Please sign in to comment.