ARGV-Struct
view release on metacpan or search on metacpan
0.01 2015-01-27 00:30:00
- First version
0.02 2015-02-04 21:30:00
- Breakage: now the arguments are JSONY compatible
(thanks to Matt S Trout for the suggestion)
- Refactor parsing code
- Better errors
- More tests
0.03 2015-08-05 23:45:00
- Compatibility with pre 5.14 Perls (GH Issue #1)
0.04 2018-09-18 22:33:00
- Migrate to Moo and Type::Tiny
0.05 2018-09-18 23:10:00
- Changes to dist.ini resulted in Makefile.PL not being generated
0.06 2018-11-28 23:00:00
- bin/argvstruct wasn't getting the correct shebang after installation (toddr)
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {
"Moo" : "0",
"Types::Standard" : "0"
}
},
"test" : {
"requires" : {
"Test::Exception" : "0",
"Test::More" : "0"
}
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/pplu/argv-struct/issues"
devel:
cpanm -n -l local --installdeps .
test: devel
PERL5LIB=local/lib/perl5 prove -I lib -v lib t/
dist:
cpanm -n -l dzil-local Dist::Zilla
PERL5LIB=dzil-local/lib/perl5 dzil-local/bin/dzil authordeps --missing | cpanm -n -l dzil-local
PERL5LIB=dzil-local/lib/perl5 dzil-local/bin/dzil smoke
PERL5LIB=dzil-local/lib/perl5 dzil-local/bin/dzil build
Makefile.PL view on Meta::CPAN
"NAME" => "ARGV::Struct",
"PREREQ_PM" => {
"Moo" => 0,
"Types::Standard" => 0
},
"TEST_REQUIRES" => {
"Test::Exception" => 0,
"Test::More" => 0
},
"VERSION" => "0.06",
"test" => {
"TESTS" => "t/*.t"
}
);
my %FallbackPrereqs = (
"Moo" => 0,
"Test::Exception" => 0,
"Test::More" => 0,
"Types::Standard" => 0
requires 'Moo';
requires 'Types::Standard';
on test => sub {
requires 'Test::More';
requires 'Test::Exception';
}
t/01_load.t view on Meta::CPAN
use Test::More;
BEGIN {
use_ok('ARGV::Struct')
}
my $argv = ARGV::Struct->new;
isa_ok($argv, 'ARGV::Struct');
done_testing;
t/03_conformance.t view on Meta::CPAN
#!/usr/bin/env perl
use Test::More;
use ARGV::Struct;
my @tests = (
{ argv => [ qw/{ X Y }/ ],
struct => { X => 'Y' },
},
{ argv => [ qw/{ X: Y }/ ],
struct => { X => 'Y' },
},
{ argv => [ qw/{ X:: Y }/ ],
struct => { 'X:' => 'Y' },
},
{ argv => [ qw/{ X Y Y { A X } }/ ],
t/03_conformance.t view on Meta::CPAN
struct => [ { Name => 'X:' }, { Name => 'Y:' } ],
},
{ argv => [ '{', 'X', ' Y ', '}' ],
struct => { X => ' Y ' },
},
{ argv => [ '{', 'X', 'Y=Y', '}' ],
struct => { X => 'Y=Y' },
},
);
foreach $test (@tests) {
eval {
is_deeply(
ARGV::Struct->new(argv => $test->{ argv })->parse,
$test->{ struct },
"Conformance of " . join ' ', @{ $test->{ argv } }
);
};
if ($@){
fail((join ' ', @{ $test->{ argv } }) . " DIED $@");
}
}
done_testing;
t/04_errors.t view on Meta::CPAN
#!/usr/bin/env perl
use Test::More;
use Test::Exception;
use ARGV::Struct;
my @tests = (
{ argv => [ qw/{/ ],
error => 'Unclosed hash',
},
{ argv => [ qw/{ X=Y Y={/ ],
error => 'Unclosed hash',
},
{ argv => [ qw/[/ ],
error => 'Unclosed list',
},
{ argv => [ qw/{ X: X X: Y }/ ],
t/04_errors.t view on Meta::CPAN
},
{ argv => [ qw/{ 3 /],
error => 'Key 3 doesn\'t',
},
{ argv => [ qw/{ X }/],
},
{ argv => [ qw/{ X: }/ ],
},
);
foreach $test (@tests) {
$test->{ error } = '.+' if (not defined $test->{ error });
throws_ok(
sub { ARGV::Struct->new(argv => $test->{ argv })->parse },
qr/$test->{ error }/,
"Conformance of " . join ' ', @{ $test->{ argv } }
);
}
done_testing;
use Test::More;
use strict;
use warnings;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
my @poddirs = qw( lib auto-lib );
all_pod_files_ok( all_pod_files( @poddirs ) );
( run in 0.463 second using v1.01-cache-2.11-cpan-87723dcf8b7 )