winterhazel commented on code in PR #156:
URL: 
https://github.com/apache/cloudstack-cloudmonkey/pull/156#discussion_r1957178119


##########
cli/completer.go:
##########
@@ -398,15 +406,23 @@ func (t *autoCompleter) Do(line []rune, pos int) (options 
[][]rune, offset int)
                                response, _ := cmd.NewAPIRequest(request, 
autocompleteAPI.Name, autocompleteAPIArgs, false)
                                t.Config.StopSpinner(spinner)
 
-                               hasID := strings.HasSuffix(arg.Name, "id=") || 
strings.HasSuffix(arg.Name, "ids=")
+                               hasID := strings.HasSuffix(arg.Name, "id=") || 
strings.HasSuffix(arg.Name, "ids=") || autocompleteAPI.Name == "listUsageTypes"
                                argOptions = buildArgOptions(response, hasID)
                        }
 
                        filteredOptions := []argOption{}
                        if len(argOptions) > 0 {
-                               sort.Slice(argOptions, func(i, j int) bool {
-                                       return argOptions[i].Value < 
argOptions[j].Value
-                               })
+                               if isNumeric(argOptions[0].Value) {

Review Comment:
   Maybe check `arg.Name` instead (or `autocompleteAPI.Name`) so that other 
APIs are not affected?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to