cli: fix help and doc strings, comments Signed-off-by: Rohit Yadav <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/00d5c3f3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/00d5c3f3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/00d5c3f3 Branch: refs/heads/master Commit: 00d5c3f35cd3966ae4c7a4e9e20732d268578886 Parents: 2add554 Author: Rohit Yadav <[email protected]> Authored: Tue Nov 6 14:22:30 2012 +0530 Committer: Rohit Yadav <[email protected]> Committed: Tue Nov 6 14:28:39 2012 +0530 ---------------------------------------------------------------------- tools/cli/cloudmonkey/cloudmonkey.py | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/00d5c3f3/tools/cli/cloudmonkey/cloudmonkey.py ---------------------------------------------------------------------- diff --git a/tools/cli/cloudmonkey/cloudmonkey.py b/tools/cli/cloudmonkey/cloudmonkey.py index 6e08adf..8b986f9 100644 --- a/tools/cli/cloudmonkey/cloudmonkey.py +++ b/tools/cli/cloudmonkey/cloudmonkey.py @@ -59,7 +59,7 @@ class CloudStackShell(cmd.Cmd): def __init__(self): self.config_fields = {'host': 'localhost', 'port': '8080', 'apiKey': '', 'secretKey': '', - 'prompt': 'ð cloudmonkey> ', 'color': 'true', + 'prompt': 'cloudmonkey> ', 'color': 'true', 'log_file': os.path.expanduser('~/.cloudmonkey_log'), 'history_file': @@ -70,7 +70,7 @@ class CloudStackShell(cmd.Cmd): for key in self.config_fields.keys(): setattr(self, key, self.config_fields[key]) config = self.write_config() - print("Set your apiKey, secretKey, host, port, prompt, color, " + print("'ð Set your apiKey, secretKey, host, port, prompt, color, " "log_file, history_file using the set command!") for key in self.config_fields.keys(): @@ -303,7 +303,9 @@ class CloudStackShell(cmd.Cmd): def do_api(self, args): """ - Make raw api calls. Syntax: api <apiName> <args>=<values>. Example: + Make raw api calls. Syntax: api <apiName> <args>=<values>. + + Example: api listAccount listall=true """ if len(args) > 0: @@ -320,6 +322,11 @@ class CloudStackShell(cmd.Cmd): """ Set config for CloudStack CLI. Available options are: host, port, apiKey, secretKey, log_file, history_file + + Example: + set host 192.168.56.2 + set prompt ð cloudmonkey> + set log_file /var/log/cloudmonkey.log """ args = args.split(' ') if len(args) == 2: @@ -348,6 +355,7 @@ def main(): 'copy', 'extract', 'migrate', 'restore', 'get', 'prepare', 'deploy', 'upload'] + # Create handlers on the fly using closures self = CloudStackShell for rule in grammar: def add_grammar(rule):
