You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! This is a fantastic project that I am using to build a new command-line application and it is working really well so far, and I am very much enjoying using it.
I have a bit of a complex use case that I wanted to ask if was reasonable to introduce some logic for.
Essentially, I have LOTS of flags that I am reusing and composing for different commands and sometimes I want to hide them since they can get noisy and potentially only show the sub-flags that are relevant instead of all of the flags in the struct.
I was wondering if it is reasonable to allow the hidden:"" value of a flag property to take a boolean so that it is possible to dynamically hide flags as it is possible to dynamically set their default values.
My thinking is that then you could use variables to hide:"${flagHidden}" and set the variables in the parent struct so that it's possible to dynamically hide flags. To avoid breaking changes I am guessing we would do the following logic:
If hidden:"" tag is present hide the flag / cmd, etc...
If hidden:"true" is set to true hide the flag / cmd, etc...
If hidden:"false" is set to false don't hide the flag.
What do you think about this? I'd suggest we implement this only if it is not too complicated as I can work around this by creating different structs with different tags and using them but it would be super nice if this logic worked as described above 😄
The text was updated successfully, but these errors were encountered:
Hey! This is a fantastic project that I am using to build a new command-line application and it is working really well so far, and I am very much enjoying using it.
I have a bit of a complex use case that I wanted to ask if was reasonable to introduce some logic for.
Essentially, I have LOTS of flags that I am reusing and composing for different commands and sometimes I want to hide them since they can get noisy and potentially only show the sub-flags that are relevant instead of all of the flags in the
struct
.I was wondering if it is reasonable to allow the
hidden:""
value of a flag property to take a boolean so that it is possible to dynamically hide flags as it is possible to dynamically set their default values.My thinking is that then you could use variables to
hide:"${flagHidden}"
and set the variables in the parent struct so that it's possible to dynamically hide flags. To avoid breaking changes I am guessing we would do the following logic:hidden:""
tag is present hide the flag / cmd, etc...hidden:"true"
is set to true hide the flag / cmd, etc...hidden:"false"
is set to false don't hide the flag.What do you think about this? I'd suggest we implement this only if it is not too complicated as I can work around this by creating different structs with different tags and using them but it would be super nice if this logic worked as described above 😄
The text was updated successfully, but these errors were encountered: