Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List free IPs when performing associate IPAddress operation #155

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cli/completer.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func findAutocompleteAPI(arg *config.APIArg, apiFound *config.API, apiMap map[st
if arg.Type == "map" {
return nil
}
config.Debug("PEARL apiFound: ", apiFound)
Pearl1594 marked this conversation as resolved.
Show resolved Hide resolved

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

autocompleteAPI := findAutocompleteAPI(arg, apiFound, apiMap)
config.Debug("api: ", autocompleteAPI)
Pearl1594 marked this conversation as resolved.
Show resolved Hide resolved
if autocompleteAPI == nil {
return nil, 0
}
Expand All @@ -391,6 +393,8 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int)
autocompleteAPIArgs = append(autocompleteAPIArgs, "type=Routing")
} else if apiFound.Name == "migrateSystemVm" {
autocompleteAPI.Name = "listSystemVms"
} else if apiFound.Name == "associateIpAddress" {
autocompleteAPIArgs = append(autocompleteAPIArgs, "state=Free")
}

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