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 (
46
46
DEFAULT = "default"
47
47
)
48
48
49
+ var nonEmptyConfigKeys = map [string ]bool {
50
+ "output" : true ,
51
+ "timeout" : true ,
52
+ "profile" : true ,
53
+ "url" : true ,
54
+ }
55
+
49
56
// DefaultACSAPIEndpoint is the default API endpoint for CloudStack.
50
57
const DefaultACSAPIEndpoint = "http://localhost:8080/client/api"
51
58
@@ -349,6 +356,10 @@ func (c *Config) LoadProfile(name string) {
349
356
350
357
// UpdateConfig updates and saves config
351
358
func (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
+ }
352
363
switch key {
353
364
case "prompt" :
354
365
c .Core .Prompt = value
You can’t perform that action at this time.
0 commit comments