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

Reserves --help for each mix task and showing bad args error with its helper #182

Open
shahryarjb opened this issue Jan 2, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@shahryarjb
Copy link
Contributor

shahryarjb commented Jan 2, 2025

Hello,

As we discussed on Discord, I think it would be great if Igniter reserves the --helps option and provides a display similar to mix help task.
This approach can help prevent mistakes for users of the CLI, especially those coming from non-Elixir stacks.


Another improvement that I believe can enhance the task is displaying a helper specific to each argument. For instance, if an argument is entered incorrectly, the task could show an error like:

** (Mix) Could not invoke task "mishka.ui.gen.component": 1 error found!
--color : Missing argument of type string

However, in a library like Clap (built on Rust), the usage of that option is also displayed. For example:

curl [options / URLs]
or
--alt-svc <file name>
or
Usage: color [OPTIONS]

This approach provides users with clear guidance on how to correctly use the options, similar to how it's presented in Unix-style commands.


By the way, since Igniter's strength lies in generating initial templates and providing a very intuitive structure, I believe that, in addition to argument definitions, composing other tasks, and similar features, it would be beneficial to include the version in its map. This way, the --version option could also be reserved automatically.

Of course, this is more of a personal suggestion, but I think it could add a nice touch to the tool's usability.

Thank you in advance

@shahryarjb shahryarjb added the enhancement New feature or request label Jan 2, 2025
@shahryarjb shahryarjb changed the title Reserves --helper for each mix task and showing bad args like its helper Reserves --helper for each mix task and showing bad args error with its helper Jan 2, 2025
@zachdaniel
Copy link
Contributor

We’d go with —help as opposed to —helper as the first is more idiomatic.

as for individual options, I believe that sort of thing should already be handled, showing an error similar to the one you described.

so the main thing would be to derive the —help message automatically.

@zachdaniel
Copy link
Contributor

And likely provide a callback to override it

@shahryarjb
Copy link
Contributor Author

shahryarjb commented Jan 3, 2025

We’d go with —help as opposed to —helper as the first is more idiomatic.

as for individual options, I believe that sort of thing should already be handled, showing an error similar to the one you described.

so the main thing would be to derive the —help message automatically.

Sorry, meant --help

@shahryarjb shahryarjb changed the title Reserves --helper for each mix task and showing bad args error with its helper Reserves --help for each mix task and showing bad args error with its helper Jan 3, 2025
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

2 participants