From: René Scharfe Date: Mon, 9 Mar 2009 20:57:38 +0000 (+0100) Subject: parseopt: prevent KEEP_UNKNOWN and STOP_AT_NON_OPTION from being used together X-Git-Tag: v1.6.3-rc0~183 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0d260f9a09a2febeb86fdada7224d271a76d2e3c?hp=0d260f9a09a2febeb86fdada7224d271a76d2e3c parseopt: prevent KEEP_UNKNOWN and STOP_AT_NON_OPTION from being used together As suggested by Junio, disallow the flags PARSE_OPT_KEEP_UNKNOWN and PARSE_OPT_STOP_AT_NON_OPTION to be turned on at the same time, as a value of an unknown option could be mistakenly classified as a non-option, stopping the parser early. E.g.: git cmd --known --unknown value arg0 arg1 The parser should have stopped at "arg0", but it already stops at "value". This patch makes parse_options() die if the two flags are used in combination. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano ---