Closed shulard closed 8 years ago
Actually, long
is an option. An option has an argument, also called a value. So the current behavior is logical if we stick on the same vocabulary ;-).
Ok, you are right... But there is no way to check if required arguments are missing in the Hoa\Console
package ?
Not directly by Hoa\Console
. It's up to you to do that.
Ok thanks :smile:
I started to write a cli script with the code :
I specified that the
long
argument is required.When I ran the script without any argument, no exception :
./script
When I ran the script with the argument but no value, exception :./script -l
I've checked in the code and it seems that the exception is thrown only when the parameter is checked through the
getOption
method.Don't you think that the
GetOption::REQUIRED_ARGUMENT
flag must throw anException
when the argument is missing ?Maybe a new flag
GetOption::REQUIRED_VALUE
is more suitable for the current behaviour ?