From 07328263c317d7ee78723fee8b66f48abffcfb36 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Fri, 10 Nov 2017 09:39:17 +0100 Subject: Add support for oauth and anonymous auth in config/CLI --- gitlab/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gitlab/cli.py') diff --git a/gitlab/cli.py b/gitlab/cli.py index 1ab7d62..af82c09 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -86,7 +86,7 @@ def _get_base_parser(): help="Verbose mode (legacy format only)", action="store_true") parser.add_argument("-d", "--debug", - help="Debug mode (display HTTP requests", + help="Debug mode (display HTTP requests)", action="store_true") parser.add_argument("-c", "--config-file", action='append', help=("Configuration file to use. Can be used " @@ -147,7 +147,8 @@ def main(): try: gl = gitlab.Gitlab.from_config(gitlab_id, config_files) - gl.auth() + if gl.private_token or gl.oauth_token: + gl.auth() except Exception as e: die(str(e)) -- cgit v1.2.1