Skip to content

Commit

Permalink
more verbose usage help
Browse files Browse the repository at this point in the history
  • Loading branch information
Сахнов Глеб Андреевич authored and Сахнов Глеб Андреевич committed Dec 3, 2021
1 parent d2fec0c commit c9cca37
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cero.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ var (
onlyValidDomainNames bool
)

var usage = "" +
`usage: cero [options] [targets]
if [targets] not provided in commandline arguments, will read from stdin
`

func main() {
// parse CLI arguments
var ports string
Expand All @@ -37,6 +42,14 @@ func main() {
flag.StringVar(&ports, "p", "443", "TLS ports to use, if not specified explicitly in host address. Use comma-separated list")
flag.IntVar(&timeout, "t", 4, "TLS Connection timeout in seconds")
flag.BoolVar(&onlyValidDomainNames, "d", false, "Output only valid domain names (e.g. strip IPs, wildcard domains and gibberish)")

// set custom usage text
flag.Usage = func() {
fmt.Fprintln(os.Stderr, usage)
fmt.Fprintln(os.Stderr, "options:")
flag.PrintDefaults()
}

flag.Parse()

// parse default port list into string slice
Expand Down

0 comments on commit c9cca37

Please sign in to comment.