cli: fix auto-completion bug
cli: fix auto-completion bug

Refactors the logic that finds the auto-completion API.

Signed-off-by: Rohit Yadav <902b9eb5dd62819678163bd5e00fbf0cbc7c264b@shapeblue.com>

apache/cloudstack-cloudmonkey,apache/cloudstack-cloudmonkey