From: Joey Hess Date: Wed, 6 Jan 2010 18:55:53 +0000 (-0500) Subject: bring back ignore_unknown_options X-Git-Tag: 7.4.12~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ed15bc2a33381f18113a95e2e855f4cfb82ee6e9;p=debhelper.git bring back ignore_unknown_options Missed that dh still uses it. --- diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm index fddbd89..214fa2d 100644 --- a/Debian/Debhelper/Dh_Getopt.pm +++ b/Debian/Debhelper/Dh_Getopt.pm @@ -145,7 +145,7 @@ sub getoptions { } my $oldwarn; - if ($params{test}) { + if ($params{test} || $params{ignore_unknown_options}) { $oldwarn=$SIG{__WARN__}; $SIG{__WARN__}=sub {}; } @@ -155,13 +155,14 @@ sub getoptions { } foreach my $opt (@test) { - # Try to parse an option, but ignore it + # Try to parse an option, and skip it # if it is not known. - if (getoptions([$opt], %params, test => 1)) { + if (getoptions([$opt], test => 1)) { getoptions([$opt], %params); } } + return 1 if $params{ignore_unknown_options}; return $ret; }