File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ const (
4646 DEFAULT = "default"
4747)
4848
49+ var nonEmptyConfigKeys = map [string ]bool {
50+ "output" : true ,
51+ "timeout" : true ,
52+ "profile" : true ,
53+ "url" : true ,
54+ }
55+
4956// DefaultACSAPIEndpoint is the default API endpoint for CloudStack.
5057const DefaultACSAPIEndpoint = "http://localhost:8080/client/api"
5158
@@ -349,6 +356,10 @@ func (c *Config) LoadProfile(name string) {
349356
350357// UpdateConfig updates and saves config
351358func (c * Config ) UpdateConfig (key string , value string , update bool ) {
359+ if nonEmptyConfigKeys [key ] && value == "" {
360+ fmt .Printf ("Error: value for '%s' must not be empty\n " , key )
361+ return
362+ }
352363 switch key {
353364 case "prompt" :
354365 c .Core .Prompt = value
You can’t perform that action at this time.
0 commit comments