Repository: python-poetry/poetry

Issue:
poetry complains about missing argument when using `--help`
<!--
  Hi there! Thank you for discovering and submitting an issue.

  Before you submit this; let's make sure of a few things.
  Please make sure the following boxes are ticked if they are correct.
  If not, please try and fulfill these first.
-->

<!-- Checked checkbox should look like this: [x] -->
- [x] I am on the [latest](https://github.com/sdispater/poetry/releases/latest) Poetry version.
- [x] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.
- [ ] If an exception occurs when executing a command, I executed it again in debug mode (`-vvv` option).

<!--
  Once those are done, if you're able to fill in the following list with your information,
  it'd be very helpful to whoever handles the issue.
-->

## Issue
<!-- Now feel free to write your issue, but please be descriptive! Thanks again 🙌 ❤️ -->

I don't know whether this is a poetry issue or cleo and if this problem arises in earlier versions.

When I type `poetry add --help` I receive the error message

```
Not enough arguments (missing: "name").
```

Similar for `poetry remove --help`

```
Not enough arguments (missing: "packages").
```

If I append any name I get the help page.

The expected behavior would be, that whenever I use `--help`, the help page should be displayed and mandatory arguments for sub command shouldn't be checked.

Saw this with version 1.0.0b6 and 1.0.0b7


Discussion:
Same issue here at 1.0.0b7 :)

But `poetry help add` will correctly show the help page.
```poetry <command> --help``` does not work for the following commands:

- add
- remove
- search
- run
- new

poetry version: 1.0.0
OS: Ubuntu 18.04.2 LTS

Resolving patch:
diff --git a/poetry/console/config/application_config.py b/poetry/console/config/application_config.py
--- a/poetry/console/config/application_config.py
+++ b/poetry/console/config/application_config.py
@@ -9,6 +9,7 @@
 from clikit.api.event import PreHandleEvent
 from clikit.api.event import PreResolveEvent
 from clikit.api.event.event_dispatcher import EventDispatcher
+from clikit.api.exceptions import CliKitException
 from clikit.api.formatter import Style
 from clikit.api.io import Input
 from clikit.api.io import InputStream
@@ -101,7 +102,16 @@ def resolve_help_command(
         if args.has_option_token("-h") or args.has_option_token("--help"):
             from clikit.api.resolver import ResolvedCommand
 
-            resolved_command = self.command_resolver.resolve(args, application)
+            try:
+                resolved_command = self.command_resolver.resolve(args, application)
+            except CliKitException:
+                # We weren't able to resolve the command,
+                # due to a parse error most likely,
+                # so we fall back on the default behavior
+                return super(ApplicationConfig, self).resolve_help_command(
+                    event, event_name, dispatcher
+                )
+
             # If the current command is the run one, skip option
             # check and interpret them as part of the executed command
             if resolved_command.command.name == "run":


Test patch: