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
OptionGroup options protected
instead of internal
#368
Comments
You can get the info you're looking for by getting all a command's options, then getting the |
Bonus question: Is there a way to filter the resulting options to |
Unfortunetely, since types are erased on the JVM, there's no way to filter on a specific delegate type. But you could filter for options with completionCandidates of type Path. It will require an unsafe cast though, and you'll need to know if your options use Alternately, you could cast them to |
Hi there! Big fan of clikt, this project is awesome. We have made a practice of extending certain clikt classes including
CliktCommand
to get additional or supportive functionality we've desired.One capability we desire is to extend
OptionGroup
so our CLI can debug log the assigned values passed to all options. Our CLI has a DEBUG flag, and an increasing number of options. It would help greatly with debugging and maintainability to report all assigned settings passed into theOptionGroup
.https://github.com/ajalt/clikt/blob/master/clikt/src/commonMain/kotlin/com/github/ajalt/clikt/parameters/groups/ParameterGroup.kt#L76
We don't have a slick way of doing this currently, because access to
OptionGroup.options
is marked asinternal
. Any reason this field cannot be madeprotected
instead, so advanced users can access all options in a group dynamically? This is a small change, but it would be a huge help.The text was updated successfully, but these errors were encountered: