Repository: miurahr/aqtinstall

Issue:
Running aqt without arguments produces error
If you run aqt without arguments, you get a confusing error:

```
C:\Users\nyanpasu64\scoop\apps\consolez\current>aqt
Traceback (most recent call last):
  File "c:\users\nyanpasu64\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\nyanpasu64\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\nyanpasu64\.local\bin\aqt.exe\__main__.py", line 7, in <module>
  File "c:\users\nyanpasu64\.local\pipx\venvs\aqtinstall\lib\site-packages\aqt\__init__.py", line 38, in main
    return cli.run()
  File "c:\users\nyanpasu64\.local\pipx\venvs\aqtinstall\lib\site-packages\aqt\cli.py", line 248, in run
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'
```

I think you should print help, if no subcommand is recognized. Maybe via `Cli.parser`'s `func`, not sure though.

Discussion:

Patch:
diff --git a/aqt/cli.py b/aqt/cli.py
index 412d454..3913ee3 100644
--- a/aqt/cli.py
+++ b/aqt/cli.py
@@ -260,4 +260,6 @@ class Cli():
     def run(self, arg=None):
         args = self.parser.parse_args(arg)
         self._setup_logging(args)
-        args.func(args)
+        if getattr(args, 'func', None) is None:
+            return self.show_help(args)
+        return args.func(args)


Test patch:
diff --git a/tests/test_cli.py b/tests/test_cli.py
index cd55909..29bb0e4 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -52,3 +52,26 @@ def test_cli_check_mirror():
     args = cli.parser.parse_args(arg)
     assert args.base == 'https://download.qt.io/'
     assert cli._check_mirror(args.base)
+
+
+def test_cli_launch_with_no_argument(capsys):
+    expected = "".join(["usage: aqt [-h] [--logging-conf LOGGING_CONF] [--logger LOGGER]\n",
+                        "           {install,tool,list,help} ...\n",
+                        "\n",
+                        "Installer for Qt SDK.\n",
+                        "\n",
+                        "optional arguments:\n",
+                        "  -h, --help            show this help message and exit\n",
+                        "  --logging-conf LOGGING_CONF\n",
+                        "                        Logging configuration ini file.\n",
+                        "  --logger LOGGER       Specify logger name\n",
+                        "\n",
+                        "subcommands:\n",
+                        "  Valid subcommands\n",
+                        "\n",
+                        "  {install,tool,list,help}\n",
+                        "                        subcommand for aqt Qt installer\n"])
+    cli = aqt.cli.Cli()
+    cli.run([])
+    out, err = capsys.readouterr()
+    assert out == expected