-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
help wantedThis issue is generally accepted and needs someone to pick it upThis issue is generally accepted and needs someone to pick it upkind:featuretopic:compiler:cli
Description
I noticed that some options like crystal spec --verbose are missing from the shell completions. To prevent missing completions like this from happening, I believe that some form of automation should be in place. One solution would be to extend OptionParser to handle shell completions as well.
Advantages
- Less barriers to entry. Knowledge of how to write completions for a specific shell (bash, zsh, etc.) is not needed. Everything is automated and leaves no room for error.
- Easily verifiable. It is easy to verify that all possible options are accounted for.
- Don't repeat yourself. You only have to change one location (the source file) to update both the program and its shell completions.
Disadvantages
- Complexity. Any form of file generation adds complexity to the build process.
- Scope. Some edge cases or other wanted features may be nontrivial to implement.
- Delegation of responsibility.
OptionParsernow handles shell completions as well.
It may also be ideal to create a command similar to crystal docs, but for shell completions instead.
Any other solutions are also appreciated. The goal of this RFC is to prevent having to write the same thing multiple times and ensure that all possible shell completions exist.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedThis issue is generally accepted and needs someone to pick it upThis issue is generally accepted and needs someone to pick it upkind:featuretopic:compiler:cli