From: Piotr Roszatycki Date: Thu, 27 Nov 2008 19:39:27 +0000 (+0000) Subject: * MooseX::Getopt::Parser::*: default config for getopt is 'default'. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70171cea83000f79fe002bf17e531ee50131c9ad;p=gitmo%2FMooseX-Getopt.git * MooseX::Getopt::Parser::*: default config for getopt is 'default'. --- diff --git a/lib/MooseX/Getopt/Parser/Descriptive.pm b/lib/MooseX/Getopt/Parser/Descriptive.pm index 44035f1..f90e8e3 100644 --- a/lib/MooseX/Getopt/Parser/Descriptive.pm +++ b/lib/MooseX/Getopt/Parser/Descriptive.pm @@ -14,8 +14,7 @@ use Getopt::Long::Descriptive (); has config => ( is => 'rw', isa => 'ArrayRef[Str]', - auto_deref => 1, - default => sub { [] }, + default => sub { [ 'default' ] }, ); # Format for usage description @@ -82,13 +81,12 @@ sub build_options { local @ARGV = @{ $getopt->ARGV }; local $SIG{__WARN__} = sub { - return warn @_ if $_[0]=~/^\###/; # Smart::Comments $warnings .= $_[0]; }; eval { ($new_options, $usage) = Getopt::Long::Descriptive::describe_options( - $self->format, @opts, { getopt_conf => [ $self->config ] } + $self->format, @opts, { getopt_conf => $self->config } ); }; my $e = $@; diff --git a/lib/MooseX/Getopt/Parser/Long.pm b/lib/MooseX/Getopt/Parser/Long.pm index 2914824..70e5f34 100644 --- a/lib/MooseX/Getopt/Parser/Long.pm +++ b/lib/MooseX/Getopt/Parser/Long.pm @@ -15,7 +15,7 @@ has config => ( is => 'rw', isa => 'ArrayRef[Str]', auto_deref => 1, - default => sub { [] }, + default => sub { [ 'default' ] }, ); @@ -53,7 +53,6 @@ sub build_options { local @ARGV = @{ $getopt->ARGV }; local $SIG{__WARN__} = sub { - return warn @_ if $_[0]=~/^\###/; # Smart::Comments $warnings .= $_[0]; };