BEGIN {
use vars qw[$VERSION $AUTOREPLY $VERBOSE $INVALID];
$VERBOSE = 1;
- $VERSION = '0.14_01';
+ $VERSION = '0.16';
$INVALID = loc('Invalid selection, please try again: ');
}
my $return = {};
### there's probably a more elegant way to do this... ###
- while ( $input =~ s/--?([-\w]+=("|').+?\2)(?:\Z|\s+)// or
- $input =~ s/--?([-\w]+=\S+)(?:\Z|\s+)// or
- $input =~ s/--?([-\w]+)(?:\Z|\s+)//
+ while ( $input =~ s/(?:\s+)--?([-\w]+=("|').+?\2)(?=\Z|\s+)// or
+ $input =~ s/(?:\s+)--?([-\w]+=\S+)(?=\Z|\s+)// or
+ $input =~ s/(?:\s+)--?([-\w]+)(?=\Z|\s+)//
) {
my $match = $1;
C<Params::Check>, C<Term::ReadLine>, C<Term::UI::History>
+=head1 BUG REPORTS
+
+Please report bugs or other issues to E<lt>bug-term-ui@rt.cpan.org<gt>.
+
=head1 AUTHOR
-This module by
-Jos Boumans E<lt>kane@cpan.orgE<gt>.
+This module by Jos Boumans E<lt>kane@cpan.orgE<gt>.
=head1 COPYRIGHT
-This module is
-copyright (c) 2002 - 2005 Jos Boumans E<lt>kane@cpan.orgE<gt>.
-All rights reserved.
+This library is free software; you may redistribute and/or modify it
+under the same terms as Perl itself.
-This library is free software;
-you may redistribute and/or modify it under the same
-terms as Perl itself.
+=cut
#### test parse_options
{
my $str = q[command --no-foo --baz --bar=0 --quux=bleh ] .
- q[--option="some'thing" -one-dash -single=blah' foo];
+ q[--option="some'thing" -one-dash -single=blah' foo bar-zot];
- my $munged = 'command foo';
+ my $munged = 'command foo bar-zot';
my $expected = {
foo => 0,
baz => 1,
my ($href,$rest) = $term->parse_options( $str );
- is_deeply( $href, $expected, q[Parsing options] );
- is($rest,$munged, q[Remaining unparsed string] );
+ is_deeply($href, $expected, qq[Parsing options] );
+ is($rest, $munged, qq[Remaining unparsed string '$munged'] );
}