Skip to content

Commit 8df6018

Browse files
committed
List free IPs when performing associate IPAddress operation
1 parent 1f45761 commit 8df6018

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/completer.go

+4
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ func findAutocompleteAPI(arg *config.APIArg, apiFound *config.API, apiMap map[st
200200
if arg.Type == "map" {
201201
return nil
202202
}
203+
config.Debug("PEARL apiFound: ", apiFound)
203204

204205
var autocompleteAPI *config.API
205206
argName := strings.Replace(arg.Name, "=", "", -1)
@@ -374,6 +375,7 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int)
374375
}
375376

376377
autocompleteAPI := findAutocompleteAPI(arg, apiFound, apiMap)
378+
config.Debug("api: ", autocompleteAPI)
377379
if autocompleteAPI == nil {
378380
return nil, 0
379381
}
@@ -391,6 +393,8 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int)
391393
autocompleteAPIArgs = append(autocompleteAPIArgs, "type=Routing")
392394
} else if apiFound.Name == "migrateSystemVm" {
393395
autocompleteAPI.Name = "listSystemVms"
396+
} else if apiFound.Name == "associateIpAddress" {
397+
autocompleteAPIArgs = append(autocompleteAPIArgs, "state=Free")
394398
}
395399

396400
spinner := t.Config.StartSpinner("fetching options, please wait...")

0 commit comments

Comments
 (0)