Skip to content

Commit

Permalink
Improve error
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna committed Oct 14, 2023
1 parent 11b8cea commit 2300826
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion x/examples/outline-connectivity/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import (
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"log"
"net"
"os"
"path"
"strings"
"time"

Expand Down Expand Up @@ -83,12 +85,19 @@ func unwrapAll(err error) error {
}
}

func init() {
flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), "Usage: %s [flags...]\n", path.Base(os.Args[0]))
flag.PrintDefaults()
}
}

func main() {
verboseFlag := flag.Bool("v", false, "Enable debug output")
transportFlag := flag.String("transport", "", "Transport config")
domainFlag := flag.String("domain", "example.com.", "Domain name to resolve in the test")
resolverFlag := flag.String("resolver", "8.8.8.8,2001:4860:4860::8888", "Comma-separated list of addresses of DNS resolver to use for the test")
protoFlag := flag.String("proto", "tcp,udp", "Comma-separated list of the protocols to test. Muse be \"tcp\", \"udp\", or a combination of them")
protoFlag := flag.String("proto", "tcp,udp", "Comma-separated list of the protocols to test. Must be \"tcp\", \"udp\", or a combination of them")

flag.Parse()
if *verboseFlag {
Expand Down

0 comments on commit 2300826

Please sign in to comment.