diff --git a/aqt/cli.py b/aqt/cli.py index eb88386..3c749be 100644 --- a/aqt/cli.py +++ b/aqt/cli.py @@ -94,13 +94,12 @@ class Cli(): def _check_mirror(self, mirror): if mirror is None: - return + pass elif mirror.startswith('http://') or mirror.startswith('https://') or mirror.startswith('ftp://'): pass else: - self.parser.print_help() - exit(1) - return mirror + return False + return True def _check_modules_arg(self, qt_version, modules): if modules is None: @@ -120,7 +119,9 @@ class Cli(): modules = args.modules sevenzip = self._set_sevenzip(args) mirror = args.base - self._check_mirror(mirror) + if not self._check_mirror(mirror): + self.parser.print_help() + exit(1) if not self._check_qt_arg_combination(qt_version, os_name, target, arch): self.logger.warning("Specified target combination is not valid: {} {} {}".format(os_name, target, arch)) if not self._check_modules_arg(qt_version, modules): diff --git a/tests/test_cli.py b/tests/test_cli.py index d0e16d9..dd154c9 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -2,8 +2,7 @@ import aqt def test_cli_help(capsys): - expected = "".join(["show help\n", - "usage: aqt [-h] [--logging-conf LOGGING_CONF] [--logger LOGGER]\n", + expected = "".join(["usage: aqt [-h] [--logging-conf LOGGING_CONF] [--logger LOGGER]\n", " {install,tool,list,help} ...\n", "\n", "Installer for Qt SDK.\n",