NAME

Getopt::Long::Negate::EN - Better negation of boolean option names

VERSION

This document describes version 0.060 of Getopt::Long::Negate::EN (from Perl distribution Getopt-Long-Negate-EN), released on 2019-04-23.

SYNOPSIS

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')

DESCRIPTION

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.

FUNCTIONS

None are exported by default, but they are exportable.

negations_for_option($str) => list

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Getopt-Long-Negate-EN.

SOURCE

Source repository is at https://github.com/perlancar/perl-Getopt-Long-Negate-EN.

BUGS

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.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

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.