Add type-set default value to help text#83
Merged
Gabriella439 merged 1 commit intoGabriella439:masterfrom Aug 30, 2021
Merged
Conversation
Owner
|
I think the more idiomatic way to do this is by setting the |
Contributor
Author
|
Ahh, I didn't know about that feature of |
Owner
|
Oh, I mean that we can fix |
c077da0 to
327190f
Compare
327190f to
61be4f9
Compare
Contributor
Author
|
Yeah, this is simpler and (I think) more idiomatic. |
Owner
|
Thank you again for contributing this! 🙂 |
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.
As mentioned in #61, it would be nice if default values showed up in help messages. This PR implements such a change that I'm using personally and thought might be desired upstream.
This is a small change so that a field with
<!> "defaultValue"will show(Default: defaultValue)in the help string. I opted to put this in theparseFieldsdefinition, which means that the order of field decorators now matters: that is, if one writes... <!> "1" <?> "Field help", then the help text will readField help (Default: 1), but if the order is... <?> "Field help" <!> "1", then the help text will readField help. This is by design so that the behavior could be overridden if desired.