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

Always report error messages for incorrect usage #262

Open
mattculler opened this issue Jul 15, 2024 · 1 comment
Open

Always report error messages for incorrect usage #262

mattculler opened this issue Jul 15, 2024 · 1 comment
Labels
Enhancement New feature or request

Comments

@mattculler
Copy link
Contributor

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.

@mattculler mattculler added the Enhancement New feature or request label Jul 15, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3119.

This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant