* Perltidy.
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt / Session.pm
index dae6c01..e0bfff0 100644 (file)
@@ -11,43 +11,43 @@ use constant _default_getopt_parser => 'MooseX::Getopt::Parser::Default';
 
 # Pluggined MooseX::Getopt::Parser parser
 has parser => (
-    is => 'rw',
-    does => 'MooseX::Getopt::Parser',
+    is      => 'rw',
+    does    => 'MooseX::Getopt::Parser',
     default => sub { $_[0]->_default_getopt_parser->new },
 );
 
 # Filter for classes which are searched for getopt trait
 has classes_filter => (
-    is => 'rw',
-    isa => 'CodeRef',
-    default => sub { sub { 1 } },
+    is      => 'rw',
+    isa     => 'CodeRef',
+    default => sub { sub { 1; } },
 );
 
 # Original @ARGV values
 has ARGV => (
-    is => 'rw',
-    isa => 'ArrayRef[Str]',
-    default => sub { [ @ARGV ] },
+    is      => 'rw',
+    isa     => 'ArrayRef[Str]',
+    default => sub { [@ARGV] },
 );
 
 # Unrecognized @ARGV values
 has extra_argv => (
-    is => 'rw',
-    isa => 'ArrayRef[Str]',
+    is      => 'rw',
+    isa     => 'ArrayRef[Str]',
     default => sub { [] },
 );
 
 # Hash with options parsed from argv
 has options => (
-    is => 'rw',
-    isa => 'HashRef',
+    is      => 'rw',
+    isa     => 'HashRef',
     default => sub { {} },
 );
 
 # Status returned by Getopt parser
 has status => (
-    is => 'rw',
-    isa => 'Bool',
+    is        => 'rw',
+    isa       => 'Bool',
     predicate => 'has_status',
 );
 
@@ -58,7 +58,7 @@ sub build_options {
     my @attrs = map { $_->_compute_getopt_attrs } $self->_compute_getopt_classes;
 
     return $self->parser->build_options( $self, @attrs );
-}
+};
 
 
 sub _compute_getopt_classes {
@@ -73,29 +73,29 @@ sub _compute_getopt_classes {
 
 
 sub _get_cmd_flags_for_attr {
-    my ($self, $attr) = @_;
+    my ( $self, $attr ) = @_;
 
     my $flag = $attr->name;
 
     my @aliases;
 
-    if ($attr->does('MooseX::Getopt::Meta::Attribute::Trait')) {
-        $flag = $attr->cmd_flag if $attr->has_cmd_flag;
+    if ( $attr->does('MooseX::Getopt::Meta::Attribute::Trait') ) {
+        $flag    = $attr->cmd_flag         if $attr->has_cmd_flag;
         @aliases = @{ $attr->cmd_aliases } if $attr->has_cmd_aliases;
     };
 
-    return ($flag, @aliases);
+    return ( $flag, @aliases );
 };
 
 
 sub _get_cmd_type_for_attr {
-    my ($self, $attr) = @_;
+    my ( $self, $attr ) = @_;
 
     my $type;
 
     $type = $attr->type_constraint if $attr->has_type_constraint;
 
-    if ($attr->does('MooseX::Getopt::Meta::Attribute::Trait')) {
+    if ( $attr->does('MooseX::Getopt::Meta::Attribute::Trait') ) {
         $type = $attr->cmd_type if $attr->has_cmd_type;
     };
 
@@ -105,6 +105,7 @@ sub _get_cmd_type_for_attr {
 
 1;
 
+
 __END__
 
 =pod
@@ -216,12 +217,12 @@ Brandon L. Black, E<lt>blblack@gmail.comE<gt>
 
 Yuval Kogman, E<lt>nothingmuch@woobling.orgE<gt>
 
+Piotr Roszatycki, E<lt>dexter@cpan.orgE<gt>
+
 =head1 CONTRIBUTORS
 
 Ryan D Johnson, E<lt>ryan@innerfence.comE<gt>
 
-Piotr Roszatycki, E<lt>dexter@cpan.orgE<gt>
-
 =head1 COPYRIGHT AND LICENSE
 
 Copyright 2007-2008 by Infinity Interactive, Inc.