Re: commons-cli: Trouble understanding the purpose of optionalArg method

2023-08-01 Thread Gary Gregory
The tests have to cover both deprecated and current APIs. Gary On Mon, Jul 31, 2023, 12:18 PM Sruteesh Kumar wrote: > But all the test cases are following deprecated OptionBuilder class right? > optionalArg is handled differently in OptionBuilder and Option.builder() > and that's where I got

Re: commons-cli: Trouble understanding the purpose of optionalArg method

2023-07-31 Thread Sruteesh Kumar
But all the test cases are following deprecated OptionBuilder class right? optionalArg is handled differently in OptionBuilder and Option.builder() and that's where I got confused Original Message On 31 Jul 2023, 8:27 pm, Gary Gregory wrote: > Please have a look at the unit

Re: commons-cli: Trouble understanding the purpose of optionalArg method

2023-07-31 Thread Gary Gregory
Please have a look at the unit tests and the web site, the combination of those two is a good way to see the API in action. Gary On Mon, Jul 31, 2023, 9:58 AM Sruteesh Kumar wrote: > What does it mean when optionalArg(true) is called for building an option? > > As per my understanding, it may

commons-cli: Trouble understanding the purpose of optionalArg method

2023-07-31 Thread Sruteesh Kumar
What does it mean when optionalArg(true) is called for building an option? As per my understanding, it may or may not take an argument. But in this case, getOptionValue is giving null even when a value is given after the option For example, if args = {"-foo","value"} and option =