-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparseFlags.go
More file actions
33 lines (26 loc) · 932 Bytes
/
parseFlags.go
File metadata and controls
33 lines (26 loc) · 932 Bytes
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
package main
import "flag"
type Flags struct {
ConfigPath string
Color string
ShowColors bool
ShowConfigs bool
Autoconfirm bool
}
func parseFlags() Flags {
var returnFlags Flags
// Get flags
configPath := flag.String("config", "~/.config/palettro/config.json", "Sets the path to the config file")
color := flag.String("color", "N/A", "New accent color to use for your RICE")
showColors := flag.Bool("showcolors", false, "Show the names of all colors registered in the config")
showConfigs := flag.Bool("showconfigs", false, "Show all the names and details of registered configs")
autoconfirm := flag.Bool("autoconfirm", false, "Skip warning about file overwrites")
flag.Parse()
// Populate struct
returnFlags.ConfigPath = *configPath
returnFlags.Color = *color
returnFlags.ShowColors = *showColors
returnFlags.ShowConfigs = *showConfigs
returnFlags.Autoconfirm = *autoconfirm
return returnFlags
}