Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "repeat" syntax prints error message #39

Open
Martchus opened this issue Oct 11, 2021 · 1 comment
Open

Using "repeat" syntax prints error message #39

Martchus opened this issue Oct 11, 2021 · 1 comment

Comments

@Martchus
Copy link

When using the "repeat" syntax documented here to allow multiple values per argument only an error message like Cannot repeat while bundling: "multiple-values=s@{1,}" is printed.

Example:

#!/bin/perl
use warnings;
use strict;
use Getopt::Long::Descriptive;

my ($opt, $usage) = describe_options(
    'test %o',
    ['multiple-values=s@{1,}',   'can have many values', {required => 1}],
    ['help',                     'prints help', {shortcircuit => 1}],
);
print $usage->text and exit if $opt->help;

I would have assumed that $opt->multiple_values would return an array ref in this case.

@Martchus
Copy link
Author

It looks like this is only an optional feature (https://docs.mojolicious.org/Getopt/Long#Options-with-multiple-values). However, it would still be nice if this module would cope with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant