From: Tomas Doran Date: Thu, 26 Nov 2009 00:25:01 +0000 (+0000) Subject: Get useful help about which option you fucked up back X-Git-Tag: 5.80014_02~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=19529022add09ffd8cec4011d679f5ea007abf5f;hp=95389116fd165c265f5b7be42e1eedde13f38181 Get useful help about which option you fucked up back --- diff --git a/Makefile.PL b/Makefile.PL index 790e8f8..ccb2a19 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -48,7 +48,7 @@ requires 'URI' => '1.35'; requires 'Task::Weaken'; requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness requires 'MRO::Compat'; -requires 'MooseX::Getopt'; +requires 'MooseX::Getopt' => '0.25'; requires 'MooseX::Types'; requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace diff --git a/TODO.scripts b/TODO.scripts index f55544d..50af8dd 100644 --- a/TODO.scripts +++ b/TODO.scripts @@ -1,2 +1,2 @@ -* Sort out help so that it shows what you fucked up. -* Fix horrible hacking around MX::Getopt's help display - probably by fixing MX::Getopt. +* Fix the horrible hacking that is Catalyst::ScriptRole::Useage +* Fix TODO tests diff --git a/lib/Catalyst/ScriptRole.pm b/lib/Catalyst/ScriptRole.pm index bb1b7ad..9e67685 100644 --- a/lib/Catalyst/ScriptRole.pm +++ b/lib/Catalyst/ScriptRole.pm @@ -5,7 +5,12 @@ use Pod::Usage; use MooseX::Getopt; use namespace::autoclean; -with 'MooseX::Getopt'; +with 'MooseX::Getopt' => { + excludes => [qw/ + _getopt_spec_warnings + _getopt_spec_exception + /], +}; has application_name => ( traits => ['NoGetopt'], @@ -21,6 +26,13 @@ has help => ( documentation => q{Display this help and exit}, ); +sub _getopt_spec_exception {} + +sub _getopt_spec_warnings { + shift; + warn @_; +} + sub _exit_with_usage { my $self = shift; pod2usage();