Thinking about this more, sometimes certain enum values should not be exposed to CLI caller and so shouldn't be printed on help screen. From the other side enum value might not be equal to CLI argument value, so here might be a better approach:
enum {
@CommandArgValue("normal", "Even returns 1. Odd returns 0.")
normal_mode,
@CommandArgValue("reversed", "Even returns 0. Odd returns 1.")
reverse_mode,
some_reserved_mode, // internal value that is not exposed to CLI
}
While I do like the idea, here's some points I need sorting out:
While a case like this will definitely happen, what should we do by default? If an enum has no @CommandArgValue members then do we provide the current behaviour, or do we force the user to provide @CommandArgValue every time for every enum for every enum value they want?
Any ideas or existing examples of how to format the help text to display this information?
_Originally posted by @andrey-zherikov in https://github.com/BradleyChatha/jcli/pull/5#discussion_r517252918:_
Here you might want to allow
@Description
UDA that will be used in help text:Thinking about this more, sometimes certain enum values should not be exposed to CLI caller and so shouldn't be printed on help screen. From the other side enum value might not be equal to CLI argument value, so here might be a better approach:
While I do like the idea, here's some points I need sorting out:
While a case like this will definitely happen, what should we do by default? If an enum has no
@CommandArgValue
members then do we provide the current behaviour, or do we force the user to provide@CommandArgValue
every time for every enum for every enum value they want?Any ideas or existing examples of how to format the help text to display this information?