And more overrideable
[gitmo/MooseX-Getopt.git] / lib / MooseX / Getopt.pm
index b942d84..3e28e45 100644 (file)
@@ -11,7 +11,7 @@ use Carp ();
 use Getopt::Long (); # GLD uses it anyway, doesn't hurt
 use constant HAVE_GLD => not not eval { require Getopt::Long::Descriptive };
 
-our $VERSION   = '0.24';
+our $VERSION   = '0.25';
 our $AUTHORITY = 'cpan:STEVAN';
 
 has ARGV       => (is => 'rw', isa => 'ArrayRef', metaclass => "NoGetopt");
@@ -67,7 +67,7 @@ sub new_with_options {
     # did the user request usage information?
     if ( $processed{usage} && ($params->{'?'} or $params->{help} or $params->{usage}) )
     {
-        $processed{usage}->die();
+        $class->_getopt_full_usage($processed{usage});
     }
 
     $class->new(
@@ -128,6 +128,11 @@ sub _getopt_spec_exception {
     die @$warnings, $exception;
 }
 
+sub _getopt_full_usage {
+    my ($self, $usage) = @_;
+    $usage->die;
+}
+
 sub _usage_format {
     return "usage: %c %o";
 }