Skip to content

Commit b2443dc

Browse files
authored
show meaningful metadata for id autocompletion in some cases (#96)
* show hypervisor,version for listhypervisorcapabilities autocompletion Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * fix for listGuestOsMappings Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent b223215 commit b2443dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/completer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ func buildArgOptions(response map[string]interface{}, hasID bool) []argOption {
129129
name = resource["name"].(string)
130130
} else if resource["username"] != nil {
131131
name = resource["username"].(string)
132+
} else if resource["hypervisor"] != nil && resource["hypervisorversion"] != nil {
133+
name = fmt.Sprintf("%s %s", resource["hypervisor"].(string), resource["hypervisorversion"].(string))
134+
if resource["osdisplayname"] != nil {
135+
name = fmt.Sprintf("%s; %s", resource["osdisplayname"].(string), name)
136+
}
132137
}
133138
if resource["displaytext"] != nil {
134139
detail = resource["displaytext"].(string)

0 commit comments

Comments
 (0)