hasOption should be checked before getOption, shouldn't it?