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/09/09 14:29:40 UTC

[1/2] git commit: CLOUDSTACK-7456: Add command line flag -d to control output display

Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/master 9662e6bcc -> b8fc61e99


CLOUDSTACK-7456: Add command line flag -d to control output display

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/f1f27e31
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/f1f27e31
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/f1f27e31

Branch: refs/heads/master
Commit: f1f27e31c1d9ac5baa30b66e1ab0e0a5da7a0f7e
Parents: 9662e6b
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Sep 9 14:12:01 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Sep 9 14:12:01 2014 +0200

----------------------------------------------------------------------
 cloudmonkey/cloudmonkey.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/f1f27e31/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index 9264d0e..bc5530c 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -563,14 +563,21 @@ class CloudMonkeyShell(cmd.Cmd, object):
 
 
 def main():
+    displayTypes = ["json", "table", "default"]
     parser = argparse.ArgumentParser(usage="cloudmonkey [options] [commands]",
                                      version="cloudmonkey " + __version__,
                                      description=__description__,
                                      epilog="Try cloudmonkey [help|?]")
+
     parser.add_argument("-c", "--config-file",
                         dest="configFile", default=config_file,
                         help="config file for cloudmonkey", metavar="FILE")
 
+    parser.add_argument("-d", "--display-type",
+                        dest="displayType", default=None,
+                        help="Output display type, json, table or default",
+                        choices=tuple(displayTypes))
+
     parser.add_argument("commands", nargs=argparse.REMAINDER,
                         help="api commands")
 
@@ -579,6 +586,9 @@ def main():
 
     shell = CloudMonkeyShell(sys.argv[0], args.configFile)
 
+    if args.displayType != None and args.displayType in displayTypes:
+        shell.set_attr("display", args.displayType)
+
     if len(args.commands) > 0:
         shell.onecmd(' '.join(args.commands))
     else:


[2/2] git commit: cloudmonkey: fix help strings

Posted by bh...@apache.org.
cloudmonkey: fix help strings

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/b8fc61e9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/b8fc61e9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/b8fc61e9

Branch: refs/heads/master
Commit: b8fc61e990e558169697659a01ab28ef20d13e78
Parents: f1f27e3
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Sep 9 14:29:18 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Sep 9 14:29:18 2014 +0200

----------------------------------------------------------------------
 cloudmonkey/cloudmonkey.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/b8fc61e9/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index bc5530c..fabbac2 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -571,7 +571,7 @@ def main():
 
     parser.add_argument("-c", "--config-file",
                         dest="configFile", default=config_file,
-                        help="config file for cloudmonkey", metavar="FILE")
+                        help="Config file for cloudmonkey", metavar="FILE")
 
     parser.add_argument("-d", "--display-type",
                         dest="displayType", default=None,
@@ -579,7 +579,7 @@ def main():
                         choices=tuple(displayTypes))
 
     parser.add_argument("commands", nargs=argparse.REMAINDER,
-                        help="api commands")
+                        help="API commands")
 
     argcomplete.autocomplete(parser)
     args = parser.parse_args()