Le 5866 Septembre 1993, Niko Tyni a envoyé:
> The "only" part isn't in the documentation :)
>
>  Any placeholder that is immediately followed by "..." [example snipped]
>  will match as many times as possible, but at least once. Note that
>  this implies that an unconstrained repeated unflagged placeholder (see
>  "Placeholder constraints" and "Unflagged placeholders") will consume
>  the rest of the command-line, and so should be specified last in the
>  POD.

Yes, the only is not in the documentation but it sound like it to me. If
there is no unflagged placeholder no one should consume the reste of the
command-line.

> The only constraint you're providing is 'group.type: string', which is
> the default type anyway, so this is effectively unconstrained. After all,
> '--hosts' is a string too.

Yes, unconstrained but not unflagged.

> It seems to me this is the intended behaviour rather than a bug, but
> please let me know what you think.

I thought that Getopt::Euclid excluded the declared options from
placeholders.

My new test case:
--8<---------------cut here---------------start------------->8---
./test.pl --groups --hosts myhost
Unknown argument: myhost
(Try: test.pl --help)
--8<---------------cut here---------------end--------------->8---

The correct error here is the missing <group>.

Regards.
-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

#!/usr/bin/perl -w

use strict;
use warnings;

use Getopt::Euclid;
use Data::Dumper;

print Dumper(%ARGV);

exit 1;

__END__

=head1 NAME

test.pl - sample Getopt::Euclid test program


=head1 REQUIRED ARGUMENTS

=over

=item --groups [=] <group> | -g [=] <group>

List of groups

=for Euclid:
    group.type: string

=item --hosts [=] <hostname>... | -h <hostname>...

List of hostnames.

=back

=cut

Attachment: pgpo1hfmOaLqg.pgp
Description: PGP signature

Reply via email to