From d4da1ac1ccae7e248b93a908b2d51e64d1153f18 Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Sun, 14 Dec 2014 21:03:11 -0800 Subject: [PATCH] Update README and cmd descriptions. --- README.md | 12 ++++++++---- cmd.go | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cc4b53d..dc86e53 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,16 @@ Usage: ssh-chat [OPTIONS] Application Options: - -v, --verbose Show verbose logging. - -b, --bind= Host and port to listen on. (0.0.0.0:22) - -i, --identity= Private key to identify server with. (~/.ssh/id_rsa) + -v, --verbose Show verbose logging. + -i, --identity= Private key to identify server with. (~/.ssh/id_rsa) + --bind= Host and port to listen on. (0.0.0.0:22) + --admin= Fingerprint of pubkey to mark as admin. + --whitelist= Optional file of pubkey fingerprints that are allowed to connect + --motd= Message of the Day file (optional) + --pprof= enable http server for pprof Help Options: - -h, --help Show this help message + -h, --help Show this help message ``` After doing `go get github.com/shazow/ssh-chat` on this repo, you should be able diff --git a/cmd.go b/cmd.go index 82398b5..9a36566 100644 --- a/cmd.go +++ b/cmd.go @@ -4,11 +4,11 @@ import ( "bufio" "fmt" "io/ioutil" + "net/http" "os" "os/signal" "os/user" "strings" - "net/http" "github.com/alexcesaro/log" "github.com/alexcesaro/log/golog" @@ -22,9 +22,9 @@ type Options struct { Identity string `short:"i" long:"identity" description:"Private key to identify server with." default:"~/.ssh/id_rsa"` Bind string `long:"bind" description:"Host and port to listen on." default:"0.0.0.0:22"` Admin []string `long:"admin" description:"Fingerprint of pubkey to mark as admin."` - Whitelist string `long:"whitelist" description:"Optional file of pubkey fingerprints that are allowed to connect"` - Motd string `long:"motd" description:"Message of the Day file (optional)"` - Pprof int `long:"pprof" description:"enable http server for pprof"` + Whitelist string `long:"whitelist" description:"Optional file of pubkey fingerprints who are allowed to connect."` + Motd string `long:"motd" description:"Optional Message of the Day file."` + Pprof int `long:"pprof" description:"Enable pprof http server for profiling."` } var logLevels = []log.Level{ @@ -45,7 +45,7 @@ func main() { } if options.Pprof != 0 { - go func(){ + go func() { fmt.Println(http.ListenAndServe(fmt.Sprintf("localhost:%d", options.Pprof), nil)) }() }