Repository: cloudstack-cloudmonkey
Updated Branches:
  refs/heads/master 6fe874d90 -> fa79185f7


cloudmonkey: ArgumentParser no longer accepts version in Python 3.3

Thanks to Anton/SBP for reporting this.

Signed-off-by: Rohit Yadav <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/commit/fa79185f
Tree: 
http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/tree/fa79185f
Diff: 
http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/diff/fa79185f

Branch: refs/heads/master
Commit: fa79185f7774004c56af4938ffb8a07f639b0697
Parents: 6fe874d
Author: Rohit Yadav <[email protected]>
Authored: Mon Oct 13 10:21:37 2014 +0530
Committer: Rohit Yadav <[email protected]>
Committed: Mon Oct 13 10:22:11 2014 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack-cloudmonkey/blob/fa79185f/cloudmonkey/cloudmonkey.py
----------------------------------------------------------------------
diff --git a/cloudmonkey/cloudmonkey.py b/cloudmonkey/cloudmonkey.py
index 711bf2d..526f454 100644
--- a/cloudmonkey/cloudmonkey.py
+++ b/cloudmonkey/cloudmonkey.py
@@ -598,17 +598,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("-v", "--version", action="version",
+                        default=argparse.SUPPRESS,
+                        version="cloudmonkey %s" % __version__,
+                        help="show CloudMonkey's version and exit")
+
     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,
-                        help="Output display type, json, table or default",
+                        help="output display type, json, table or default",
                         choices=tuple(displayTypes))
 
     parser.add_argument("commands", nargs=argparse.REMAINDER,

Reply via email to