* MooseX::Getopt::Parser::Descriptive: fixed regression: does not require CLI param...
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt.pm
index 1e7c91a..48ea79e 100644 (file)
@@ -49,7 +49,8 @@ sub new_with_options {
     my $getopt = defined $params{getopt}
                  ? $params{getopt}
                  : $class->_default_getopt_session->new(
-                      classes_filter => sub { $_ eq $class }
+                      classes_filter => sub { $_ eq $class },
+                      params => \%params,
                   );
 
     my %options = $getopt->options;
@@ -58,8 +59,9 @@ sub new_with_options {
         ARGV       => [ $getopt->argv ],        # backward compatibility
         extra_argv => [ $getopt->extra_argv ],  # backward compatibility
         getopt     => $getopt,
-        %params,      # explicit params to ->new
-        %options,     # params from CLI
+        %{ $getopt->params },                   # params from session object
+        %params,                                # explicit params to ->new
+        %options,                               # params from CLI
     );
 };