summaryrefslogtreecommitdiff
path: root/gitlab/cli.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-30 17:44:29 +0100
committerGauvain Pocentek <gauvain.pocentek@objectif-libre.com>2016-01-30 17:44:29 +0100
commit00ab7d00a553e68eea5668dbf455404925fef6e0 (patch)
treed4b958d09c96efb62af3b87886966bd3e1928e1b /gitlab/cli.py
parent9f256a71aa070bf28c70b2242976fbb0bc758bc4 (diff)
downloadgitlab-00ab7d00a553e68eea5668dbf455404925fef6e0.tar.gz
Rework the __version__ import
This simplifies the setup.py script Also provide a --version option for CLI
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r--gitlab/cli.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py
index 7843423..7fa176c 100644
--- a/gitlab/cli.py
+++ b/gitlab/cli.py
@@ -240,8 +240,14 @@ def do_project_owned(gl, what, args):
def main():
+ if "--version" in sys.argv:
+ print(gitlab.__version__)
+ exit(0)
+
parser = argparse.ArgumentParser(
description="GitLab API Command Line Interface")
+ parser.add_argument("--version", help="Display the version.",
+ action="store_true")
parser.add_argument("-v", "--verbose", "--fancy",
help="Verbose mode",
action="store_true")