From: Shlomi Fish Date: Thu, 13 Aug 2009 20:46:07 +0000 (+0300) Subject: Reverted the latest commit. X-Git-Tag: 0.22~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6140ec5ce9db92643fac5ac4b862db477c91ba0f;p=gitmo%2FMooseX-Getopt.git Reverted the latest commit. --- diff --git a/lib/MooseX/Getopt.pm b/lib/MooseX/Getopt.pm index fea359f..5807378 100644 --- a/lib/MooseX/Getopt.pm +++ b/lib/MooseX/Getopt.pm @@ -71,7 +71,9 @@ sub _parse_argv { local @ARGV = @{ $params{params}{argv} || \@ARGV }; - my ( $opt_spec, $name_to_init_arg ) = ( HAVE_GLD ? $class->_gld_spec(%params) : $class->_traditional_spec(%params) ); + my $use_gld = (HAVE_GLD && !$params{params}{disable_gld}); + + my ( $opt_spec, $name_to_init_arg ) = ( $use_gld ? $class->_gld_spec(%params) : $class->_traditional_spec(%params) ); # Get a clean copy of the original @ARGV my $argv_copy = [ @ARGV ]; @@ -81,7 +83,7 @@ sub _parse_argv { my ( $parsed_options, $usage ) = eval { local $SIG{__WARN__} = sub { push @err, @_ }; - if ( HAVE_GLD ) { + if ( $use_gld ) { return Getopt::Long::Descriptive::describe_options($class->_usage_format(%params), @$opt_spec); } else { my %options; @@ -426,6 +428,9 @@ and then return a newly constructed object. The special parameter C, if specified should point to an array reference with an array to use instead of C<@ARGV>. +The paramater C, if specified and a true value will disable +the use of L . + If L fails (due to invalid arguments), C will throw an exception.