You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/10/30 15:18:30 UTC
git commit: cloudmonkey: autocomplete true/false for boolean arg types
Repository: cloudstack-cloudmonkey
Updated Branches:
refs/heads/5.3 715630aeb -> 6f71acf22
cloudmonkey: autocomplete true/false for boolean arg types
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/6f71acf2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/6f71acf2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/6f71acf2
Branch: refs/heads/5.3
Commit: 6f71acf220adec616c3c77cd933c00f93908042e
Parents: 715630a
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Thu Oct 30 19:47:51 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Thu Oct 30 19:47:51 2014 +0530
----------------------------------------------------------------------
cloudmonkey/cloudmonkey.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/6f71acf2/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index f07fd67..45e67c9 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -440,8 +440,11 @@ class CloudMonkeyShell(cmd.Cmd, object):
if not api:
logger.debug("[Paramcompl] Using relative approx")
params = self.apicache[verb][subject]['params']
- related = filter(lambda x: x['name'] == param,
- params)[0]['related']
+ arg = filter(lambda x: x['name'] == param, params)[0]
+ if "type" in arg and arg["type"] == "boolean":
+ return filter(lambda x: x.startswith(value),
+ ["true", "false"])
+ related = arg['related']
apis = filter(lambda x: 'list' in x, related)
logger.debug("[Paramcompl] Related APIs: %s" % apis)
if len(apis) > 0: