Getopt::Long::Negate::EN - Better negation of boolean option names
This document describes version 0.060 of Getopt::Long::Negate::EN (from Perl distribution Getopt-Long-Negate-EN), released on 2019-04-23.
use Getopt::Long::Negate::EN qw(negations_for_option); # the Getopt::Long's default @negs = negations_for_option('foo'); # ('no-foo', 'nofoo') @negs = negations_for_option('with-foo'); # ('without-foo') @negs = negations_for_option('without-foo'); # ('with-foo') @negs = negations_for_option('is-foo'); # ('isnt-foo') @negs = negations_for_option('isnt-foo'); # ('is-foo') @negs = negations_for_option('are-foo'); # ('isnt-foo') @negs = negations_for_option('arent-foo'); # ('arent-foo') @negs = negations_for_option('has-foo'); # ('hasnt-foo') @negs = negations_for_option('hasnt-foo'); # ('has-foo') @negs = negations_for_option('have-foo'); # ('havent-foo') @negs = negations_for_option('havent-foo'); # ('have-foo') @negs = negations_for_option('can-foo'); # ('cant-foo') @negs = negations_for_option('cant-foo'); # ('can-foo') @negs = negations_for_option('enabled-foo'); # ('disabled-foo') @negs = negations_for_option('disabled-foo');# ('enabled-foo') @negs = negations_for_option('enable-foo'); # ('disable-foo') @negs = negations_for_option('disable-foo'); # ('enable-foo') @negs = negations_for_option('allowed-foo'); # ('disallowed-foo') @negs = negations_for_option('disallowed-foo'); # ('allowed-foo') @negs = negations_for_option('allow-foo'); # ('disallow-foo') @negs = negations_for_option('disallow-foo'); # ('allow-foo') @negs = negations_for_option('include-foo'); # ('exclude-foo') @negs = negations_for_option('exclude-foo'); # ('include-foo') @negs = negations_for_option('no-foo'); # ('foo')
This module aims to provide a nicer negative boolean option names. By default, Getopt::Long provides options --foo as well as --no-foo and --nofoo if you specify boolean option specification foo!. But this produces awkward/incorrect English word like --nowith-foo or --no-is-foo. In those two cases, --without-foo and --isnt-foo are better option names.
--foo
--no-foo
--nofoo
foo!
--nowith-foo
--no-is-foo
--without-foo
--isnt-foo
None are exported by default, but they are exportable.
Please visit the project's homepage at https://metacpan.org/release/Getopt-Long-Negate-EN.
Source repository is at https://github.com/perlancar/perl-Getopt-Long-Negate-EN.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Getopt-Long-Negate-EN
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2019, 2016, 2015 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Getopt::Long::Negate::EN, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Getopt::Long::Negate::EN
CPAN shell
perl -MCPAN -e shell install Getopt::Long::Negate::EN
For more information on module installation, please visit the detailed CPAN module installation guide.