-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Description
It appears that opts_present() as it is now is broken. It calls find_opt() for each option string and returns true as soon as result is matched against Some(_), but find_opt() returns Some(i) (i being the index of the opt in the Matches.opts vector) when an option is legit (regardless of it being matched). This leads to opts_present() returning true always unless one of the options in the input vector is absent from Matches.opts. Test suite works because it is tested true against options that have been specified, and false against illegal options, but there is no test for optional arguments that have not been specified in the command line. Calling opt_present() instead of opts_present() for each string in vector works as expected.
TL;DR: opts_present() behaves as if it were named opts_matchable().