← Back to issue list

Always report error messages for incorrect usage

View original Github issue

Metadata

Project
craft-cli
Number
#262
Type
issue
State
open
Author
mattculler
Labels
Created
2024-07-15 18:18:15+00:00
Updated
2025-03-10 18:59:09+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### What needs to get done Most CLI usage errors output exactly what I would expect - a basic usage line, suggestion to consult `-h`, and an error message: ``` $ corncraft foo Usage: corncraft [options] command [args]... Try 'corncraft -h' for help. Error: no such command 'foo' $ corncraft pack --foo Usage: corncraft [options] command [args]... Try 'corncraft pack -h' for help. Error: unrecognized arguments: --foo ``` But passing no command at all will instead output the help text, with no explanation. (It does return nonzero.) The "no command specified" case should get its own message. In my view, even a generic error message would be better than the help text, which is annoying - I would argue that we should also change the case where help output is displayed in response to a generic error. ### Why it needs to get done This will likely be confusing for new users.

Evaluation history

No evaluation history available.