Skip to content

gitlab CLI --help not working as expected #381

Closed
@jelaiw

Description

@jelaiw

Just a quick report that gitlab CLI --help appears to not be working as expected.

In brief, gitlab CLI shows the help for "gitlab --help" even for calls for more specific help (e.g. "gitlab project --help" or "gitlab project list --help").

See below.

$ python3 --version
Python 3.6.3
$ python3 -m venv test-env
$ source test-env/bin/activate
(test-env) $ pip install --upgrade python-gitlab
Collecting python-gitlab
  Downloading python-gitlab-1.1.0.tar.gz (117kB)
    100% |████████████████████████████████| 122kB 1.9MB/s
Collecting requests>=1.0 (from python-gitlab)
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
    100% |████████████████████████████████| 92kB 1.9MB/s
Collecting six (from python-gitlab)
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=1.0->python-gitlab)
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 2.1MB/s
Collecting certifi>=2017.4.17 (from requests>=1.0->python-gitlab)
  Downloading certifi-2017.11.5-py2.py3-none-any.whl (330kB)
    100% |████████████████████████████████| 337kB 1.6MB/s
Collecting urllib3<1.23,>=1.21.1 (from requests>=1.0->python-gitlab)
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
    100% |████████████████████████████████| 133kB 2.8MB/s
Collecting idna<2.7,>=2.5 (from requests>=1.0->python-gitlab)
  Downloading idna-2.6-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 2.9MB/s
Installing collected packages: chardet, certifi, urllib3, idna, requests, six, python-gitlab
  Running setup.py install for python-gitlab ... done
Successfully installed certifi-2017.11.5 chardet-3.0.4 idna-2.6 python-gitlab-1.1.0 requests-2.18.4 six-1.11.0 urllib3-1.22
(test-env) $ gitlab project --help
usage: gitlab [-h] [--version] [-v] [-d] [-c CONFIG_FILE] [-g GITLAB]
              [-o {json,legacy,yaml}] [-f FIELDS]

GitLab API Command Line Interface

optional arguments:
  -h, --help            show this help message and exit
  --version             Display the version.
  -v, --verbose, --fancy
                        Verbose mode (legacy format only)
  -d, --debug           Debug mode (display HTTP requests
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        Configuration file to use. Can be used multiple times.
  -g GITLAB, --gitlab GITLAB
                        Which configuration section should be used. If not
                        defined, the default selection will be used.
  -o {json,legacy,yaml}, --output {json,legacy,yaml}
                        Output format (v4 only): json|legacy|yaml
  -f FIELDS, --fields FIELDS
                        Fields to display in the output (comma separated). Not
                        used with legacy output
(test-env) $ gitlab project list --help
usage: gitlab [-h] [--version] [-v] [-d] [-c CONFIG_FILE] [-g GITLAB]
              [-o {json,legacy,yaml}] [-f FIELDS]

GitLab API Command Line Interface

optional arguments:
  -h, --help            show this help message and exit
  --version             Display the version.
  -v, --verbose, --fancy
                        Verbose mode (legacy format only)
  -d, --debug           Debug mode (display HTTP requests
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        Configuration file to use. Can be used multiple times.
  -g GITLAB, --gitlab GITLAB
                        Which configuration section should be used. If not
                        defined, the default selection will be used.
  -o {json,legacy,yaml}, --output {json,legacy,yaml}
                        Output format (v4 only): json|legacy|yaml
  -f FIELDS, --fields FIELDS
                        Fields to display in the output (comma separated). Not
                        used with legacy output

I should say that I am a new python-gitlab user and I may be doing something dumb, so let me know if that is the case. I am just following the docs at http://python-gitlab.readthedocs.io/en/stable/cli.html.

A workaround right now is just to type "gitlab project foo" or something like that to trigger the CLI error path, which presents usage hints (which was what I was after in the first place).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions