On Tue, May 13, 2008 at 12:26 PM, Allan McRae <mcrae_allan@hotmail.com> wrote:
+valid_options=0 +for opt in ${options[@]}; do + known=1 + # check if option matches a known option or its inverse + for kopt in ${known_options[@]}; do + if [ "${opt}" = "${kopt}" -o "${opt}" = "!${kopt}" ]; then + known=0 + fi + done + if [ $known -eq 1 ]; then + error "$(gettext "options array contains unknown option '%s'")" "$opt" + valid_options=1 + fi +done +if [ $valid_options -eq 1 ]; then + exit 1 +fi
No big deal, but in my mind, the boolean value should be reversed. known == 1 == true, or known == 0 == false. So inverting known and valid_options make more sense to me :) Other than that, the patch looks fine so I pulled it with that change : http://shining.toofishes.net/gitweb/gitweb.cgi?p=pacman.git;a=commitdiff;h=8...