Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top-level help command is broken #1629

Closed
Martchus opened this issue Dec 16, 2020 · 4 comments · Fixed by #1643
Closed

Top-level help command is broken #1629

Martchus opened this issue Dec 16, 2020 · 4 comments · Fixed by #1643

Comments

@Martchus
Copy link

  • Mojolicious version: 8.67
  • Perl version: 5.32.0
  • Operating system: openSUSE Tumbleweed

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 added a commit to Martchus/openQA that referenced this issue Dec 16, 2020
* Otherwise `--help` for a top-level listing of commands fails and
  therefore t/44-scripts.t.
* See mojolicious/mojo#1629
@Martchus
Copy link
Author

I guess this commit causes the problem: d009374

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 kraih added the bug label Dec 16, 2020
@kraih
Copy link
Member

kraih commented Dec 16, 2020

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

@Martchus
Copy link
Author

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
Copy link
Member

kraih commented Dec 16, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants