diff --git a/Makefile b/Makefile index c51609b..82cc5e1 100644 --- a/Makefile +++ b/Makefile @@ -47,9 +47,9 @@ update: config-make-readable: cat ~/.config/cloud-control-panel.json |jq -r --tab -config-load-testconfig: +config-default-config: echo loading the test config - cp resources/cloud-control-panel.json ~/.config/cloud-control-panel.json + ./cloud-control-panel --defaultconfig config-delete: echo deleting your current config diff --git a/config.go b/config.go index 4d9c5e6..e6911e7 100644 --- a/config.go +++ b/config.go @@ -68,6 +68,7 @@ var customUsage = func() { fmt.Println(os.Args[0] + " --hostname test.hostname.wit.com") fmt.Println("") } +var defaultconfig *bool func parseFlags() { var hostname string @@ -81,6 +82,7 @@ func parseFlags() { height := flag.Int ("height", 0, "Height of the Window") width := flag.Int ("width", 0, "Width of the Window") debug = flag.Bool("debug", false, "Enable debugging") + defaultconfig = flag.Bool("defaultconfig", false, "Use the default config file") debugtable = flag.Bool("debugtable", false, "Enable GUI table debugging") // Set the output if something fails to stdout rather than stderr @@ -110,8 +112,8 @@ func parseFlags() { } // never allow these to be set in the config file - config.Debug = *debug - config.Debugtable = *debugtable + config.Debug = *debug + config.Debugtable = *debugtable } // Convert a Protobuf to JSON @@ -208,7 +210,7 @@ func parseConfig() { if (config.Accounts == nil) { log.Println("loadConfigFile() config.Accounts == nil") log.Println("If debugging is on, should load default config here") - if (config.Debug) { + if (*defaultconfig == true) { log.Println("Debugging is on, loading debug config accounts") tmp := loadDefaultConfig() config.Accounts = tmp.Accounts