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

Support "one_of" from Getopt::Long::Descriptive #73

Open
afresh1 opened this issue Oct 8, 2021 · 4 comments
Open

Support "one_of" from Getopt::Long::Descriptive #73

afresh1 opened this issue Oct 8, 2021 · 4 comments

Comments

@afresh1
Copy link

afresh1 commented Oct 8, 2021

It would be nice to have the ability to have options where you can only use "one_of" them, as supported by Getopt::Long::Descriptive.

@rehsack
Copy link
Collaborator

rehsack commented Oct 11, 2021

Since MooX::Options passes everything to Getopt::Long::Descriptive, it should work out of the box.
Please give it a try and in doubt, send a test which demonstrates how it fails.

@afresh1
Copy link
Author

afresh1 commented Oct 12, 2021

I thought it would, but I couldn't get it to work. I tried converting the example:

option mode => (
    is => 'ro',
    doc => 'hidden',
    one_of => [
        [ get => "get the value" ],
        [ set => "set the value" ],
        [ delete => "delete it" ],
    ],
);

but it says "Unknown option: get" and doesn't list get, set, or delete in the --help output. Perhaps I am just failing to read the docs properly.

@rehsack
Copy link
Collaborator

rehsack commented Oct 15, 2021

I check it as soon as possible

@afresh1
Copy link
Author

afresh1 commented Oct 16, 2021

No worries, it would just be helpful. If you feel like looking, have at it. If it become important enough I will better understand it and submit a patch.

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

2 participants