Przeglądaj źródła

Make the usage message prettier

Lucas Stadler 10 lat temu
rodzic
commit
7cc4dec177
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      go/stars/stars.go

+ 8 - 0
go/stars/stars.go

@ -21,6 +21,14 @@ var config struct {
21 21
func init() {
22 22
	flag.StringVar(&config.directory, "directory", "github-stars", "The directory to store the repos in")
23 23
	flag.IntVar(&config.concurrency, "concurrency", 10, "The number of repos to update concurrently")
24
25
	flag.Usage = func() {
26
		fmt.Fprintf(os.Stderr, "Usage: %s [flags]\n\n", os.Args[0])
27
		fmt.Fprintf(os.Stderr, "Fetches your GitHub stars and updates them as necessary.\n\n")
28
		flag.PrintDefaults()
29
		fmt.Fprintf(os.Stderr, "  -h, --help\n\tDisplay this message\n")
30
	}
31
24 32
}
25 33
26 34
func main() {