Catch condition in optparser where a flag like -v is passed but no targe...

...ts are passed in.

Refs #8016.

@s0undt3ch please review. I see that you used a ret code of 42 elsewhere in the code but I can't find anywhere that's specifically defined. Could you comment and let me know? Thanks.