You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2021/09/21 06:38:42 UTC

[cloudstack-cloudmonkey] branch main updated: show meaningful metadata for id autocompletion in some cases (#96)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack-cloudmonkey.git


The following commit(s) were added to refs/heads/main by this push:
     new b2443dc  show meaningful metadata for id autocompletion in some cases (#96)
b2443dc is described below

commit b2443dc1206bd53708a32dfeaf5437c5c00bef4b
Author: Abhishek Kumar <ab...@gmail.com>
AuthorDate: Tue Sep 21 12:08:27 2021 +0530

    show meaningful metadata for id autocompletion in some cases (#96)
    
    * show hypervisor,version for listhypervisorcapabilities autocompletion
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
    
    * fix for listGuestOsMappings
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
---
 cli/completer.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cli/completer.go b/cli/completer.go
index 650c84b..dee1461 100644
--- a/cli/completer.go
+++ b/cli/completer.go
@@ -129,6 +129,11 @@ func buildArgOptions(response map[string]interface{}, hasID bool) []argOption {
 					name = resource["name"].(string)
 				} else if resource["username"] != nil {
 					name = resource["username"].(string)
+				} else if resource["hypervisor"] != nil && resource["hypervisorversion"] != nil {
+					name = fmt.Sprintf("%s %s", resource["hypervisor"].(string), resource["hypervisorversion"].(string))
+					if resource["osdisplayname"] != nil {
+						name = fmt.Sprintf("%s; %s", resource["osdisplayname"].(string), name)
+					}
 				}
 				if resource["displaytext"] != nil {
 					detail = resource["displaytext"].(string)