From: Tomas Doran Date: Tue, 8 Feb 2011 19:35:03 +0000 (+0000) Subject: Whitespace pickyness X-Git-Tag: 0.34~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Ftopic%2Fjswartz-process-args;p=gitmo%2FMooseX-Getopt.git Whitespace pickyness --- diff --git a/lib/MooseX/Getopt/Basic.pm b/lib/MooseX/Getopt/Basic.pm index 1a66be5..9bb62ba 100644 --- a/lib/MooseX/Getopt/Basic.pm +++ b/lib/MooseX/Getopt/Basic.pm @@ -64,25 +64,23 @@ sub process_argv { my $params = $config_from_file ? { %$config_from_file, %{$processed{params}} } : $processed{params}; # did the user request usage information? - if ( $processed{usage} and $params->{help_flag} ) - { + if ( $processed{usage} and $params->{help_flag} ) { $class->_getopt_full_usage($processed{usage}); } - return MooseX::Getopt::ProcessedArgv->new - ( + return MooseX::Getopt::ProcessedArgv->new( argv_copy => $processed{argv_copy}, extra_argv => $processed{argv}, usage => $processed{usage}, constructor_params => $constructor_params, # explicit params to ->new cli_params => $params, # params from CLI - ); + ); } sub new_with_options { my ($class, @params) = @_; - my $pa = $class->process_argv(@params); + my $pa = $class->process_argv(@params); $class->new( ARGV => $pa->argv_copy, @@ -90,7 +88,7 @@ sub new_with_options { ( $pa->usage ? ( usage => $pa->usage ) : () ), %{ $pa->constructor_params }, # explicit params to ->new %{ $pa->cli_params }, # params from CLI - ); + ); } sub _getopt_spec { shift->_traditional_spec(@_); } diff --git a/t/011_process_argv.t b/t/011_process_argv.t index c56b1fb..01c55bb 100644 --- a/t/011_process_argv.t +++ b/t/011_process_argv.t @@ -19,20 +19,20 @@ else { package Testing::Foo; use Moose; - + with 'MooseX::Getopt'; - + has 'bar' => ( is => 'ro', - isa => 'Int', + isa => 'Int', required => 1, ); - + has 'baz' => ( is => 'ro', - isa => 'Int', - required => 1, - ); + isa => 'Int', + required => 1, + ); } @ARGV = qw(--bar 10 file.dat);