mojolicious / mojo

:sparkles: Mojolicious - Perl real-time web framework
https://mojolicious.org
Artistic License 2.0
2.66k stars 576 forks source link

Top-level help command is broken #1629

Closed Martchus closed 3 years ago

Martchus commented 3 years ago

Steps to reproduce the behavior

mojo help

Expected behavior

List available commands with short descriptions (according to https://docs.mojolicious.org/Mojolicious/Commands#help) and a zero return code. It would also be nice if --help would work (and not just help without dashes).

Actual behavior

Invalid command "help". is printed with return code 2.

Martchus commented 3 years ago

I guess this commit causes the problem: https://github.com/mojolicious/mojo/commit/d0093749c73557bf0be66f76f541749667d04511

Ironically, you introduced it because I was asking for it and it actually works to detect invalid arguments. The only problem is that it also considers --help or help invalid.

kraih commented 3 years ago

Yes, this is a bug and needs to be fixed.

Martchus commented 3 years ago

By the way, I've already added a workaround for openQA. So at least for us there's no need to rush it. (Better do the improvement right this time.)

kraih commented 3 years ago

I'm surprised that we don't have a test case yet for mojo help. Will have to add one with the fix. Probably because unlike other commands, which are real modules, it's just an if block in Mojolicious::Commands.