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
feature: add method to hide option extras #2156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried about adding one off functions to tweak yargs' default layout. What if instead we did something like we did with parserConfiguration
. Add a helper usageConfiguration
, which we can gradually add more layout options to:
yargs.usageConfiguration({
'show-types': false
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jly36963 this is great work, thank you 👏
One ask, would it be possible to add this setting in the list here: https://github.com/yargs/yargs/blob/main/docs/api.md#parserconfigurationobj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this. I think usageConfiguration
will help us provide nuanced configuration without adding 1,000,000 additional methods.
I’m a bit confused; how can i show types in general, but hide types for an a specific option? |
@ljharb I don't think there is a way currently. It would likely be a new property on option/positional objects like I won't be involved with this package much in the future, so I won't be much help in implementing this change |
In that case, this does not solve #1145, thanks for confirming. |
Addresses: #2153
Description
Given the following:
The
hideOptionExtras
would cause the following outputto look like this instead
Questions
If this works, I'll add unit tests.
What other things would need to change? (docs, examples, etc)