diff --git a/README.md b/README.md index 51560f3..298c3e0 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ func main() { } ``` -Since API is centered around [regexp.Regexp](https://golang.org/pkg/regexp/#Regexp), -many other methods are available, such as finding the [byte indexes](https://golang.org/pkg/regexp/#Regexp.FindAllIndex) +Since API is centered around [regexp.Regexp](https://pkg.go.dev/regexp#Regexp), +many other methods are available, such as finding the [byte indexes](https://pkg.go.dev/regexp#Regexp.FindAllIndex) for all matches. The regular expressions are compiled when the API is first called. diff --git a/cmd/xurls/main.go b/cmd/xurls/main.go index 201aaa7..3a56281 100644 --- a/cmd/xurls/main.go +++ b/cmd/xurls/main.go @@ -47,7 +47,7 @@ func init() { flag.Var(&fix, "fix", "") flag.Usage = func() { fmt.Fprint(os.Stderr, ` -Usage: xurls [-h] [files] +Usage: xurls [flags] [files] xurls extracts urls from text using regular expressions. If no files are given, it reads from standard input. @@ -230,6 +230,9 @@ func main1() int { case "auto", "all": // enabled via -fix=auto, -fix=all, etc case "true": // enabled via -fix; normalize fix = "auto" + default: + flag.Usage() + return 1 } var re *regexp.Regexp if *relaxed {