Replies: 3 comments
-
What exactly do you have in mind when you say "default value"? CmdOption itself has no notion of a default value. It especially does not set a default value in case the user provided no option. All it does is to not set values for not given options. |
Beta Was this translation helpful? Give feedback.
-
There are some posibilities, e.g.:
|
Beta Was this translation helpful? Give feedback.
-
Consider the following option definitions:
Here I have two optional options, limit and offset, where limit defaults to 1000 and offset to 0 (which are replaced if you provide the option). As you see I am putting the defaults in the description and my request was simply if it would be possible to automatically add that to the description. If it is difficult to infer the default value (like I am using it) and it would be easier to use one of the methods you mention, I think option 1 (textual default) would fit my use case the best. That also sounds like the simplest option to implement. |
Beta Was this translation helpful? Give feedback.
-
It would be nice to show the default values with the usage information.
Beta Was this translation helpful? Give feedback.
All reactions