cmd/torrent: Nicer usage

This commit is contained in:
Matt Joiner 2015-03-20 23:18:32 +11:00
parent 73d8eef468
commit ed8e89a60c
1 changed files with 8 additions and 0 deletions

View File

@ -27,8 +27,16 @@ var (
upload = flag.Bool("upload", true, "upload data to peers")
)
func usage() {
fmt.Fprintf(os.Stderr, "Usage: %s [flags] (magnet URI or .torrent file path)...\n", os.Args[0])
os.Stderr.WriteString("Download using the BitTorrent network.\n")
flag.PrintDefaults()
}
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
flag.Usage = usage
flag.Parse()
client, err := torrent.NewClient(&torrent.Config{
DataDir: *downloadDir,