1
0
mirror of https://github.com/nikolaydubina/calendarheatmap.git synced 2025-02-01 13:28:10 +02:00

better flags

This commit is contained in:
Nikolay 2020-12-09 20:52:01 +08:00
parent 2be3928de6
commit ba6e94d94c

18
main.go
View File

@ -15,11 +15,19 @@ import (
func main() {
os.Setenv("CALENDAR_HEATMAP_ASSETS_PATH", "charts/assets")
colorScale := *flag.String("colorscale", "PuBu9", "refer to colorscales for examples")
labels := *flag.Bool("labels", true, "labels for weekday and months")
monthSep := *flag.Bool("monthsep", true, "render month separator")
outputFormat := *flag.String("output", "png", "output format (png, jpeg, gif, svg)")
locale := *flag.String("locale", "en_US", "locale of labels (en_US, ko_KR)")
var (
colorScale string
labels bool
locale string
monthSep bool
outputFormat string
)
flag.BoolVar(&labels, "labels", true, "labels for weekday and months")
flag.BoolVar(&monthSep, "monthsep", true, "render month separator")
flag.StringVar(&colorScale, "colorscale", "PuBu9", "refer to colorscales for examples")
flag.StringVar(&locale, "locale", "en_US", "locale of labels (en_US, ko_KR)")
flag.StringVar(&outputFormat, "output", "png", "output format (png, jpeg, gif, svg)")
flag.Parse()
data, err := ioutil.ReadAll(os.Stdin)