From 48ade301801a135c392082efac4f69dd97cd79d1 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Fri, 14 Mar 2014 17:56:35 +0100 Subject: [PATCH] Implement "sahara --version" Implement common --version option. Change-Id: I9b8c5508bf986ab7318443b69857856b36719f57 --- saharaclient/shell.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/saharaclient/shell.py b/saharaclient/shell.py index 098edbe1..bb6aa163 100644 --- a/saharaclient/shell.py +++ b/saharaclient/shell.py @@ -36,6 +36,7 @@ import sys import pkg_resources import six + HAS_KEYRING = False all_errors = ValueError try: @@ -59,6 +60,7 @@ from saharaclient.nova import extension as nova_extension from saharaclient.openstack.common.apiclient import exceptions as exc from saharaclient.openstack.common import cliutils from saharaclient.openstack.common import strutils +from saharaclient import version DEFAULT_API_VERSION = 'api' DEFAULT_ENDPOINT_TYPE = 'publicURL' @@ -239,10 +241,9 @@ class OpenStackSaharaShell(object): action='store_true', help=argparse.SUPPRESS) -# NA -# parser.add_argument('--version', -# action='version', -# version=saharaclient.__version__) + parser.add_argument('--version', + action='version', + version=version.version_info.version_string()) parser.add_argument('--debug', default=False,