Skip to content

Commit 74698cd

Browse files
authored
Fix autocompletion for API arguments (#133)
* Fix autocompletion for migrateSystemVms * Fix createNetwork associatednetworkid param autocompletion
1 parent 7c4dd34 commit 74698cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/completer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ func findAutocompleteAPI(arg *config.APIArg, apiFound *config.API, apiMap map[st
219219
relatedNoun = "publicipaddresses"
220220
case argName == "storageid":
221221
relatedNoun = "storagepools"
222+
case argName == "associatednetworkid":
223+
relatedNoun = "networks"
222224
default:
223225
// Heuristic: autocomplete for the arg for which a list<Arg without id/ids>s API exists
224226
// For example, for zoneid arg, listZones API exists
@@ -387,6 +389,8 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int)
387389

388390
if apiFound.Name != "provisionCertificate" && autocompleteAPI.Name == "listHosts" {
389391
autocompleteAPIArgs = append(autocompleteAPIArgs, "type=Routing")
392+
} else if apiFound.Name == "migrateSystemVm" {
393+
autocompleteAPI.Name = "listSystemVms"
390394
}
391395

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

0 commit comments

Comments
 (0)