commit 8a55f452226ce038127e2c00d6c4f64a89363fb2 Author: David Fifield david@bamsoftware.com Date: Thu Apr 10 09:11:36 2014 -0700
Put command-line usage in --help output. --- meek-client-torbrowser/meek-client-torbrowser.go | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/meek-client-torbrowser/meek-client-torbrowser.go b/meek-client-torbrowser/meek-client-torbrowser.go index 5309e02..0fd66ea 100644 --- a/meek-client-torbrowser/meek-client-torbrowser.go +++ b/meek-client-torbrowser/meek-client-torbrowser.go @@ -12,6 +12,7 @@ package main import ( "bufio" "flag" + "fmt" "io" "io/ioutil" "log" @@ -25,6 +26,11 @@ import (
var helperAddrPattern *regexp.Regexp
+func usage() { + fmt.Fprintf(os.Stderr, "Usage: %s [meek-client-torbrowser args] -- meek-client [meek-client args]\n", os.Args[0]) + flag.PrintDefaults() +} + // Log a call to os.Process.Kill. func logKill(p *os.Process) error { log.Printf("killing PID %d", p.Pid) @@ -115,6 +121,7 @@ func main() { var logFilename string var err error
+ flag.Usage = usage flag.StringVar(&logFilename, "log", "", "name of log file") flag.Parse()
tor-commits@lists.torproject.org