How to know if CommandContext.getOptionValue returns default value or argument value?

20 Views Asked by At

Say I have command options Lorem and Ipsum.

Lorem is of type String[].class while Ipsum is of type boolean.class.

Lorem has a default value of "a,b,c" while Ipsum has a default value of "false".

My command can be "cmd --ipsum --lorem a,c,d".

Using CommandContext.getCommandRegistration().get Options() I can get the list of all the commands and their default values. Their default values are String, but the result value is not necessarily String, so I can't compare directly like so.

I know the conversation is happening using convertOptionType() but I'm not sure how to use it properly, because arity is involved in there.

0

There are 0 best solutions below