Handle settings
This commit is contained in:
parent
8f64a349ec
commit
25a4d7be2c
7 changed files with 208 additions and 56 deletions
|
|
@ -10,6 +10,7 @@ func (c *Config) declareFlags() {
|
|||
flag.StringVar(&c.BaseURL, "baseurl", c.BaseURL, "URL prepended to each URL")
|
||||
flag.StringVar(&c.Bind, "bind", c.Bind, "Bind port/socket")
|
||||
flag.StringVar(&c.DevProxy, "dev", c.DevProxy, "Use ui directory instead of embedded assets")
|
||||
flag.StringVar(&c.SettingsFile, "settings-file", c.SettingsFile, "Path to the file containing the settings")
|
||||
flag.StringVar(&c.TracksDir, "tracks-dir", c.TracksDir, "Path to the directory containing the tracks")
|
||||
flag.StringVar(&c.GongsDir, "gongs-dir", c.GongsDir, "Path to the directory containing the gongs")
|
||||
flag.StringVar(&c.ActionsDir, "actions-dir", c.ActionsDir, "Path to the directory containing the actions")
|
||||
|
|
@ -21,11 +22,12 @@ func (c *Config) declareFlags() {
|
|||
func Consolidated() (cfg *Config, err error) {
|
||||
// Define defaults options
|
||||
cfg = &Config{
|
||||
Bind: "127.0.0.1:8080",
|
||||
TracksDir: "./tracks/",
|
||||
GongsDir: "./gongs/",
|
||||
ActionsDir: "./actions/",
|
||||
RoutinesDir: "./routines/",
|
||||
Bind: "127.0.0.1:8080",
|
||||
SettingsFile: "./settings.json",
|
||||
TracksDir: "./tracks/",
|
||||
GongsDir: "./gongs/",
|
||||
ActionsDir: "./actions/",
|
||||
RoutinesDir: "./routines/",
|
||||
}
|
||||
|
||||
cfg.declareFlags()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue