-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
39 lines (32 loc) · 1.08 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"flag"
"fmt"
"log"
"os"
)
func main() {
cfg := &Config{}
flag.StringVar(&cfg.Template, "t", "template.json", "Path to template file")
flag.StringVar(&cfg.Template, "template", "template.json", "Path to template file")
flag.StringVar(&cfg.Output, "o", "dist", "Directory for generated files")
flag.StringVar(&cfg.Output, "output", "dist", "Directory for generated files")
flag.StringVar(&cfg.Prefix, "p", "$", "Variable prefix")
flag.StringVar(&cfg.Prefix, "prefix", "$", "Variable prefix")
flag.StringVar(&cfg.Format, "f", "hex", "Color output format")
flag.StringVar(&cfg.Format, "format", "hex", "Color output format")
flag.BoolVar(&cfg.StripSpaces, "s", false, "Strip spaces in output")
flag.BoolVar(&cfg.StripSpaces, "strip-spaces", false, "Strip spaces in output")
help := flag.Bool("help", false, "Show help")
flag.Bool("h", false, "Show help")
flag.Parse()
if *help {
fmt.Println("🌱 Bloom - The Rosé Pine theme generator")
fmt.Println("\nUsage:")
flag.PrintDefaults()
os.Exit(0)
}
if err := Build(cfg); err != nil {
log.Fatal(err)
}
}