diff --git a/tuskarclient/__init__.py b/tuskarclient/__init__.py index e69de29..6280215 100644 --- a/tuskarclient/__init__.py +++ b/tuskarclient/__init__.py @@ -0,0 +1,16 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import pbr.version + + +__version__ = pbr.version.VersionInfo('python-tuskarclient').version_string() diff --git a/tuskarclient/shell.py b/tuskarclient/shell.py index 264323e..59105e9 100755 --- a/tuskarclient/shell.py +++ b/tuskarclient/shell.py @@ -23,6 +23,7 @@ import sys import six +import tuskarclient from tuskarclient import client import tuskarclient.common.utils as utils from tuskarclient.openstack.common.apiclient import exceptions as exc @@ -68,8 +69,8 @@ class TuskarShell(object): self._ensure_auth_info(args) - tuskar_client = client.get_client(self.partial_args.tuskar_api_version, - **args.__dict__) + tuskar_client = client.get_client( + self.partial_args.tuskar_api_version, **args.__dict__) args.func(tuskar_client, args) def _ensure_auth_info(self, args): @@ -134,6 +135,11 @@ class TuskarShell(object): help="Print this help message and exit.", ) + parser.add_argument('--version', + action='version', + version=tuskarclient.__version__, + help="Shows the client version and exits.") + parser.add_argument('--os-username', default=utils.env('OS_USERNAME'), help='Defaults to env[OS_USERNAME]',