Просмотр исходного кода

Make the usage message prettier

Lucas Stadler лет назад: 10
Родитель
Сommit
7cc4dec177
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      go/stars/stars.go

+ 8 - 0
go/stars/stars.go

21
func init() {
21
func init() {
22
	flag.StringVar(&config.directory, "directory", "github-stars", "The directory to store the repos in")
22
	flag.StringVar(&config.directory, "directory", "github-stars", "The directory to store the repos in")
23
	flag.IntVar(&config.concurrency, "concurrency", 10, "The number of repos to update concurrently")
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
func main() {
34
func main() {