diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-11-10 09:39:17 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-11-10 09:39:17 +0100 |
commit | 07328263c317d7ee78723fee8b66f48abffcfb36 (patch) | |
tree | 1922a5ae37ed1903d1e02d35e725f6205081ac56 /gitlab/cli.py | |
parent | e9b158363e5b0ea451638b1c3a660f138a24521d (diff) | |
download | gitlab-07328263c317d7ee78723fee8b66f48abffcfb36.tar.gz |
Add support for oauth and anonymous auth in config/CLI
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 5 |
1 files changed, 3 insertions, 2 deletions
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)) |