Avoid duplicate argument placeholders in Crystal CLI help - #17162
Open
kojix2 wants to merge 1 commit into
Open
Conversation
Member
|
I'm not sure if this is a good change. It makes the help text more concise, but also less clear. |
Contributor
Author
|
Another possibility is for OptionParser to normalize the help text. For example: opts.on("-o FILE", "--output FILE", "Output path.")could be displayed as: Ruby’s OptionParser does this. However, it would be a behavior change that reduces control over the help output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello.
This pull request proposes changing the help messages for the Crystal compiler.
It does not intend to change the compiler behavior.
Currently, some options show the same argument placeholder for both the short and long forms.
This looks a little redundant, especially after indentation was added for long options.
I considered changing
OptionParserbehavior, but that would affect how users can format their own help messages.So this pull request only updates the option definitions used by the Crystal compiler.
With this change, the argument placeholder is kept only on the long option.
There are variations in argument notation, such as
--foo BAR,--foo=BAR, and--foo <bar>.However, they are outside the scope of this pull request.
Thank you.