diff options
author | Eric Multanen <eric.w.multanen@intel.com> | 2020-09-02 21:28:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-09-02 21:28:23 +0000 |
commit | a330e54f63ecadf3b9332e9504cb51f843a2d853 (patch) | |
tree | b8e54b1f171f7a8a0064fdd883fe218e4ec96a7c /src/tools/emcoctl/cmd/root.go | |
parent | 1898c1f1ece6ec8c02d599f1ca4f1cda1166e0de (diff) | |
parent | d8ed6e76a40b8942c2b56c623dcc097d734e3dca (diff) |
Merge "Update CLI with complete get implementation"
Diffstat (limited to 'src/tools/emcoctl/cmd/root.go')
-rw-r--r-- | src/tools/emcoctl/cmd/root.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/emcoctl/cmd/root.go b/src/tools/emcoctl/cmd/root.go index 4c1ac19f..7648606a 100644 --- a/src/tools/emcoctl/cmd/root.go +++ b/src/tools/emcoctl/cmd/root.go @@ -38,7 +38,6 @@ var rootCmd = &cobra.Command{ // This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { if err := rootCmd.Execute(); err != nil { - fmt.Println("Test") fmt.Println(err) os.Exit(1) } @@ -55,7 +54,7 @@ func init() { // initConfig reads in config file and ENV variables if set. func initConfig() { - cfgFile = "emco-cfg.yaml" + if cfgFile != "" { // Use config file from the flag. viper.SetConfigFile(cfgFile) @@ -66,7 +65,6 @@ func initConfig() { fmt.Println(err) os.Exit(1) } - fmt.Println(home) // Search config in home directory with name ".emco" (without extension). viper.AddConfigPath(home) viper.SetConfigName(".emco") @@ -81,5 +79,8 @@ func initConfig() { if err != nil { fmt.Printf("Unable to decode into struct, %v", err) } + } else { + fmt.Println("Warning: No Configuration File found. Using defaults") + SetDefaultConfiguration() } }
\ No newline at end of file |