--- /dev/null
+pm_to_blib
+inc
+blib
+Makefile
+Makefile.old
+META.yml
+MANIFEST
+MANIFEST.bak
Revision history for Perl extension MooseX-Getopt
+0.20 Wed. July 9 2009
+ ~ fix MANIFEST.SKIP to avoid double-packaging
+
+0.19 Wed. July 8 2009
+ * MooseX::Getopt
+ - Fix Getopt config spec for --configfile (t0m)
+ - Add support for --usage/--help/--? (drew@drewtaylor.com)
+ - Fix new_with_options to accept a hashref (DOUGDUDE@cpan.org)
+
+ * Tests
+ - Fix warning from tests with new Moose (t0m)
+ - Fix tests on Win32 from RT#44909 (taro-nishino)
+
0.18 Thu. April 9 2009
* MooseX::Getopt::Dashes
- New module, for converting undercores to dashes (ilmari)
+++ /dev/null
-ChangeLog
-inc/Module/AutoInstall.pm
-inc/Module/Install.pm
-inc/Module/Install/AutoInstall.pm
-inc/Module/Install/Base.pm
-inc/Module/Install/Can.pm
-inc/Module/Install/Fetch.pm
-inc/Module/Install/Include.pm
-inc/Module/Install/Makefile.pm
-inc/Module/Install/Metadata.pm
-inc/Module/Install/Win32.pm
-inc/Module/Install/WriteAll.pm
-lib/MooseX/Getopt.pm
-lib/MooseX/Getopt/Dashes.pm
-lib/MooseX/Getopt/Meta/Attribute.pm
-lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm
-lib/MooseX/Getopt/Meta/Attribute/Trait.pm
-lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm
-lib/MooseX/Getopt/OptionTypeMap.pm
-lib/MooseX/Getopt/Strict.pm
-Makefile.PL
-MANIFEST
-META.yml
-README
-t/000_load.t
-t/001_basic.t
-t/002_custom_option_type.t
-t/003_inferred_option_type.t
-t/004_nogetop.t
-t/005_strict.t
-t/006_metaclass_traits.t
-t/007_nogetopt_trait.t
-t/008_configfromfile.t
-t/009_gld_and_explicit_options.t
-t/010_dashes.t
-t/100_gld_default_bug.t
-t/pod.t
-t/pod_coverage.t
+^.git
^_build
^Build$
^blib
\.old$
^#.*#$
^\.#
-^TODO$
\ No newline at end of file
+^TODO$
+^MooseX-Getopt
build_requires 'Test::Exception' => '0.21';
tests_recursive();
-auto_install;
+auto_manifest();
WriteAll;
-MooseX::Getopt version 0.18
+MooseX::Getopt version 0.20
===========================
See the individual module documentation for more information
use Getopt::Long (); # GLD uses it anyway, doesn't hurt
use constant HAVE_GLD => not not eval { require Getopt::Long::Descriptive };
-our $VERSION = '0.18';
+our $VERSION = '0.20';
our $AUTHORITY = 'cpan:STEVAN';
has ARGV => (is => 'rw', isa => 'ArrayRef', metaclass => "NoGetopt");
my $params = $config_from_file ? { %$config_from_file, %{$processed{params}} } : $processed{params};
+ # did the user request usage information?
+ if ( $processed{usage} && ($params->{'?'} or $params->{help} or $params->{usage}) )
+ {
+ $processed{usage}->die();
+ }
+
$class->new(
ARGV => $processed{argv_copy},
extra_argv => $processed{argv},
- @params, # explicit params to ->new
+ %$constructor_params, # explicit params to ->new
%$params, # params from CLI
);
}
my $opt_string = join(q{|}, $flag, @aliases);
- if ($attr->has_type_constraint) {
+ if ($attr->name eq 'configfile') {
+ $opt_string .= '=s';
+ }
+ elsif ($attr->has_type_constraint) {
my $type = $attr->type_constraint;
if (MooseX::Getopt::OptionTypeMap->has_option_type($type)) {
$opt_string .= MooseX::Getopt::OptionTypeMap->get_option_type($type)
params from the command line (possibly overriding those in C<%params>)
and then return a newly constructed object.
+The special parameter C<argv>, if specified should point to an array
+reference with an array to use instead of C<@ARGV>.
+
If L<Getopt::Long/GetOptions> fails (due to invalid arguments),
C<new_with_options> will throw an exception.
+If L<Getopt::Long::Descriptive> is installed and any of the following
+command line params are passed, the program will exit with usage
+information. You can add descriptions for each option by including a
+B<documentation> option for each attribute to document.
+
+ --?
+ --help
+ --usage
+
If you have L<Getopt::Long::Descriptive> the C<usage> param is also passed to
C<new>.
Ryan D Johnson, E<lt>ryan@innerfence.comE<gt>
+Drew Taylor, E<lt>drew@drewtaylor.comE<gt>
+
=head1 COPYRIGHT AND LICENSE
Copyright 2007-2008 by Infinity Interactive, Inc.
use Moose;
use Moose::Util::TypeConstraints;
-our $VERSION = '0.18';
+our $VERSION = '0.20';
our $AUTHORITY = 'cpan:STEVAN';
extends 'Moose::Meta::Attribute'; # << Moose extending Moose :)
package MooseX::Getopt::Meta::Attribute::NoGetopt;
use Moose;
-our $VERSION = '0.18';
+our $VERSION = '0.20';
our $AUTHORITY = 'cpan:STEVAN';
extends 'Moose::Meta::Attribute'; # << Moose extending Moose :)
use Moose::Role;
use Moose::Util::TypeConstraints;
-our $VERSION = '0.18';
+our $VERSION = '0.20';
our $AUTHORITY = 'cpan:STEVAN';
has 'cmd_flag' => (
package MooseX::Getopt::Meta::Attribute::Trait::NoGetopt;
use Moose::Role;
-our $VERSION = '0.18';
+our $VERSION = '0.20';
our $AUTHORITY = 'cpan:STEVAN';
no Moose::Role;
use Moose 'confess', 'blessed';
use Moose::Util::TypeConstraints 'find_type_constraint';
-our $VERSION = '0.18';
+our $VERSION = '0.20';
our $AUTHORITY = 'cpan:STEVAN';
my %option_type_map = (
isa => 'Int',
default => 713
);
-
- has '_private_stuff_cmdline' => (
- is => 'ro',
- isa => 'Int',
- default => 832,
- cmd_flag => 'p',
- );
-
}
{
use Test::Exception;
use Test::More;
+use File::Spec;
if ( !eval { require MooseX::ConfigFromFile } )
{
optional_from_config => 'from_config_2',
);
- if ( $file ne '/notused/default' ) {
+ my $cpath = File::Spec->canonpath('/notused/default');
+ if ( $file ne $cpath ) {
$config{config_from_override} = 1;
}
extends 'App';
has '+configfile' => (
- default => '/notused/default',
+ default => File::Spec->canonpath('/notused/default'),
);
}
ok( !$app->config_from_override,
'... config_from_override false as expected' );
- is( $app->configfile, '/notused/default',
+ is( $app->configfile, File::Spec->canonpath('/notused/default'),
'... configfile is /notused/default as expected' );
}
}
ok( $app->config_from_override,
'... config_from_override true as expected' );
- is( $app->configfile, '/notused',
+ is( $app->configfile, File::Spec->canonpath('/notused'),
'... configfile is /notused as expected' );
}
}