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

Add CLI default help message #47

Open
ariel-m-s opened this issue Apr 7, 2021 · 2 comments
Open

Add CLI default help message #47

ariel-m-s opened this issue Apr 7, 2021 · 2 comments
Labels
proposal For new ideas not being considered at that moment

Comments

@ariel-m-s
Copy link
Contributor

I think that showing a help message when using the CLI in a wrong way would be helpful. For instance, when typing zum (without any arguments), the CLI currently outputs an exception (as shown bellow). I find this to be a little aggresive for newcomers (like me) who are beginning to experiment with Zum.

Traceback (most recent call last):
  File "/usr/local/bin/zum", line 8, in <module>
    sys.exit(dispatcher())
  File "/usr/local/lib/python3.9/site-packages/zum/cli.py", line 22, in dispatcher
    engine.execute(parsed_args.action[0], parsed_args.params)  # pragma: nocover
AttributeError: 'Namespace' object has no attribute 'action'

This help message should’t be as complete as the documentation, but should provide some practical information such as a list of commands and possible arguments.

@ariel-m-s
Copy link
Contributor Author

ariel-m-s commented Apr 7, 2021

I realized that you can type zum --help to get some help. Maybe this message should be extended (with the list of possible commands and that kind of things) and set as a default message everytime the user does something wrong.

@daleal
Copy link
Owner

daleal commented Apr 8, 2021

The --help message already includes the list of possible commands (when a valid zum.toml file exists), but I do agree that maybe exceptions that aren't caught and stored by the engine should be caught at the CLI level, the exception should be displayed and then the help message should be shown.

@daleal daleal added the proposal For new ideas not being considered at that moment label Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal For new ideas not being considered at that moment
Projects
None yet
Development

No branches or pull requests

2 participants