Getopt-Long-Descriptive-0.117 000755 000765 000024 0 15145670555 15401 5 ustar 00rjbs staff 000000 000000 README 100644 000765 000024 613 15145670555 16322 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 This archive contains the distribution Getopt-Long-Descriptive,
version 0.117:
Getopt::Long, but simpler and more powerful
This software is copyright (c) 2005 by Hans Dieter Pearcey.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
This README file was generated by Dist::Zilla::Plugin::Readme v6.037.
Changes 100644 000765 000024 17136 15145670555 17005 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 Revision history for Getopt-Long-Descriptive
0.117 2026-02-19 15:24:11-05:00 America/New_York
- add (experimental!!) generation of bash/zsh completion scripts for
GLD-powered programs; this code might go away or change or break in
the future, don't rely on it… yet?
0.116 2024-12-30 16:13:39-05:00 America/New_York
- do not leave Getopt::Long configuration in an altered state after
getting options
0.115 2024-11-07 18:00:02+00:00 Europe/Dublin
- cope with the user forgetting the first argument, generally "%c %o",
to `describe_options`, by assuming they meant that value exactly
0.114 2024-01-20 17:14:21-05:00 America/New_York
- a switch with (required => 0) is no longer treated as a required!
0.113 2023-12-15 16:55:46-05:00 America/New_York
- improve line wrapping so spacers (non-option text lines) can use more
horizontal characters
- replace tabs (generally 8 space) indents in output with four spaces
0.112 2023-11-20 19:34:53-05:00 America/New_York
- This version removes the redundant option warning, which is now
provided by Getopt::Long v2.55 and later -- which is now required!
As before, this will someday become fatal.
0.111 2022-12-31 21:15:52-05:00 America/New_York
- clean up the required perl version in the code
- update author contact info
0.110 2021-10-30 23:11:43-04:00 America/New_York
- just small packaging updates
- ...and bumped the minimum perl to v5.12 (inadvertantly)
0.109 2021-03-16 19:55:45-04:00 America/New_York
- eliminate warnings-count failure by requiring an ExtUtils::MakeMaker
from late 2013 or later; without this, very old EUMM could pass -w
to the tests, enabling more warnings than we wanted (thanks, Matthew
Horsfall and Graham Knop!)
0.108 2021-03-16 09:54:51-04:00 America/New_York
- provide diagnostics in tests when more warnings arrive than are
expected
0.107 2021-03-14 16:15:57-04:00 America/New_York
- Term::ReadKey has been dropped; caused too many problems
- minimum version is now v5.10.1, not v5.10.0
0.106 2021-03-12 21:29:54-05:00 America/New_York
- improved formatting of switches
- when available, use Term::ReadKey to get terminal width
- when an option name is defined twice, warn about it
THIS WILL BECOME FATAL IN A FUTURE VERSION
0.105 2020-02-26 09:40:36+11:00 Australia/Melbourne
- one_of suboptions now get accessors (thanks, Michael McClimon!)
0.104 2019-04-27 10:50:50+01:00 Europe/London
- allow for verbatim text in descripition options
0.103 2018-08-02 11:11:30-04:00 America/New_York
- show --[no-]option for boolean toggle options
0.102 2018-02-20 14:44:17-05:00 America/New_York
- long spacer lines are now line broken
- "empty" spacer lines no longer have leading whitespace
- option specifications ":+" and ":5" (etc.) now get better
presentation in the usage description
0.101 2018-01-21 19:32:11-05:00 America/New_York
- escape some unescaped braces in regex
0.100 2016-07-11 22:21:26-04:00 America/New_York
- show off "shortcircuit" in synopsis (thanks, Zhenyi Zhou)
- Fix rendering of complex types ('i@' → 'INT...', etc)
(thanks, Arthur Axel fREW Schmidt)
0.099 2015-01-23 21:11:09-05:00 America/New_York
- options that take arguments now indicate the argument's type and
whether it can be given multiply (thanks, Niels Thykier)
0.098 2014-11-16 14:35:34-05:00 America/New_York
- when showing defaults, show false ones, too
0.097 2014-03-05 21:57:32-05:00 America/New_York
- explicitly make the default behavior case-sensitive
- add show_defaults option (thanks, Thomas Neumann)
0.096 2013-10-04 08:03:12 America/New_York
- update version of Test::Warnings required
(thanks, Alexandr Ciornii!)
0.095 2013-09-26 20:32:55 America/New_York
- add the "shortcircuit" option option (thanks, Diab Jerius!)
0.094 2013-09-05 09:35:26 America/New_York
- update documentation to note that failed validation is fatal (thanks,
SMYLERS)
- show off "required" in the SYNOPSIS (thanks, OALDERS)
0.093 2012-11-01 15:55:35 America/New_York
- bogus %-codes in usage description are now noticed and fatal
0.092 2012-07-31 22:51:09 America/New_York
- make "hidden" options usable on their own (thanks, Roman Hubacek!)
0.091 2012-02-22 18:15:08 America/New_York
- don't die quite so violently when a Params::Validate constraint fails
(initial patch by harleypig@github; final blame to RJBS)
0.090 2011-04-21 20:43:07 America/New_York
- bump prereq on Params::Validate to deal with recent buggy versions
0.089 2011-01-13
- bump version to deal with busted PAUSE indexing
0.088 2011-01-12
- fix infinite loop when long option documentation strings couldn't wrap
(HDP)
0.087 2010-11-30
- long option documentation strings are now line-wrapped and aligned
correctly (Dave Rolsky)
0.086 2010-09-19
- fix minimum required version of Sub::Exporter
- minor tweak to avoid warnings when run with -w
0.085 2010-03-13
- rewrite much of the documentation
0.084 2010-02-14
- prevent auto-enabling of auto_help (Thanks, DOUGDUDE)
0.083 2009-12-12
- create an Opts module to store the opts object code
- add _specified_opts method and _specified method for Opts
0.082 2009-12-03
- require Getopt::Long 2.33 for proper --no-foo handling
0.081 2009-11-27
- \%opt will not contain entries for opts that were not given
(this reverts 0.079 and 0.080's new behavior of undef entries)
0.080 2009-11-27
- fix option naming to ignore "+" used to mark cumulative options
- fix direct calls to Getopt::Long::Descriptive::describe_options
0.079 2009-11-26 Happy Thanksgiving!
- improve the "opt as object" facility to have all opts as methods
0.078 2009-08-21
- refactoring to allow subclassing of Getopt::Long::Descriptive
0.077 2009-08-21
- allow 'f' as an option name; had mistakenly required 2 characters
0.076 2009-08-20
- bundle the accidentally omitted Usage.pm file
- the $opt returned by described_options is now an object with accessors
0.075 2009-08-19
- significant refactoring, especially to GLD::Usage, which is now a more
traditional (non-hash-based) object (RJBS)
0.074 2008-05-11
- fix RT#35678 (thanks RJBS)
0.073 2008-04-04
- packaging fix
0.072 2008-04-03
- remove duplicate option name in test
0.071 2008-04-03
- fix RT#34153 (bcbailey++)
0.070 2008-01-29
- fix RT#32481 (nothingmuch++)
0.06 2006-08-20
- Required options should not give an unhelpful
Params::Validate error message when they're missing.
- Add %c to 'format' for command name.
- Use [] for spacers in option list.
0.05 2006-01-25
- Support negatable ('foo!') options from Getopt::Long.
0.04 2005-11-28
- Include IO::Scalar prereq in Makefile.PL
0.03 2005-11-15
- Add 'one_of' and 'hidden'.
0.02 2005-11-10
- Bugfix: Getopt::Long type specifiers were sneaking
into option names
0.01 2005-11-10
- First version, released on an unsuspecting world.
LICENSE 100644 000765 000024 46326 15145670555 16522 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 This software is copyright (c) 2005 by Hans Dieter Pearcey.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Terms of the Perl programming language system itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2005 by Hans Dieter Pearcey.
This is free software, licensed under:
The GNU General Public License, Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see .
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
, 1 April 1989
Moe Ghoul, President of Vice
That's all there is to it!
--- The Perl Artistic License 1.0 ---
This software is Copyright (c) 2005 by Hans Dieter Pearcey.
This is free software, licensed under:
The Perl Artistic License 1.0
The "Artistic License"
Preamble
The intent of this document is to state the conditions under which a
Package may be copied, such that the Copyright Holder maintains some
semblance of artistic control over the development of the package,
while giving the users of the package the right to use and distribute
the Package in a more-or-less customary fashion, plus the right to make
reasonable modifications.
Definitions:
"Package" refers to the collection of files distributed by the
Copyright Holder, and derivatives of that collection of files
created through textual modification.
"Standard Version" refers to such a Package if it has not been
modified, or has been modified in accordance with the wishes
of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
"You" is you, if you're thinking about copying or distributing
this Package.
"Reasonable copying fee" is whatever you can justify on the
basis of media cost, duplication charges, time of people involved,
and so on. (You will not be required to justify it to the
Copyright Holder, but only to the computing community at large
as a market that must bear the fee.)
"Freely Available" means that no fee is charged for the item
itself, though there may be fees involved in handling the item.
It also means that recipients of the item may redistribute it
under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain or from the Copyright Holder. A Package
modified in such a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or
an equivalent medium, or placing the modifications on a major archive
site such as uunet.uu.net, or by allowing the Copyright Holder to include
your modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided, and provide
a separate manual page for each non-standard executable that clearly
documents how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where
to get the Standard Version.
b) accompany the distribution with the machine-readable source of
the Package with your modifications.
c) give non-standard executables non-standard names, and clearly
document the differences in manual pages (or equivalent), together
with instructions on where to get the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this
Package. You may not charge a fee for this Package itself. However,
you may distribute this Package in aggregate with other (possibly
commercial) programs as part of a larger (possibly commercial) software
distribution provided that you do not advertise this Package as a
product of your own. You may embed this Package's interpreter within
an executable of yours (by linking); this shall be construed as a mere
form of aggregation, provided that the complete Standard Version of the
interpreter is so embedded.
6. The scripts and library files supplied as input to or produced as
output from the programs of this Package do not automatically fall
under the copyright of this Package, but belong to whoever generated
them, and may be sold commercially, and may be aggregated with this
Package. If such scripts or library files are aggregated with this
Package via the so-called "undump" or "unexec" methods of producing a
binary executable image, then distribution of such an image shall
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of this Package with a commercial distribution is always
permitted provided that the use of this Package is embedded; that is,
when no overt attempt is made to make this Package's interfaces visible
to the end user of the commercial distribution. Such use shall not be
construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
dist.ini 100644 000765 000024 652 15145670555 17111 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 name = Getopt-Long-Descriptive
author = Hans Dieter Pearcey
author = Ricardo Signes
license = Perl_5
copyright_holder = Hans Dieter Pearcey
copyright_year = 2005
[@RJBS]
perl-window = long-term
[Breaks]
MooseX::Getopt = < 0.66
[Test::CheckBreaks]
conflicts_module = Moose::Conflicts
[Prereqs / ConfigureRequires]
ExtUtils::MakeMaker = 6.78 ; do not pass -w when running tests
META.yml 100644 000765 000024 33527 15145670555 16765 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 ---
abstract: 'Getopt::Long, but simpler and more powerful'
author:
- 'Hans Dieter Pearcey '
- 'Ricardo Signes '
build_requires:
CPAN::Meta::Check: '0.011'
CPAN::Meta::Requirements: '0'
ExtUtils::MakeMaker: '0'
File::Spec: '0'
Term::ANSIColor: '0'
Test::Fatal: '0'
Test::More: '0.96'
Test::Warnings: '0.005'
configure_requires:
ExtUtils::MakeMaker: '6.78'
dynamic_config: 0
generated_by: 'Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Getopt-Long-Descriptive
requires:
Carp: '0'
File::Basename: '0'
Getopt::Long: '2.55'
List::Util: '0'
Params::Validate: '0.97'
Scalar::Util: '0'
Sub::Exporter: '0.972'
Sub::Exporter::Util: '0'
overload: '0'
perl: '5.012'
strict: '0'
warnings: '0'
resources:
bugtracker: https://github.com/rjbs/Getopt-Long-Descriptive/issues
homepage: https://github.com/rjbs/Getopt-Long-Descriptive
repository: https://github.com/rjbs/Getopt-Long-Descriptive.git
version: '0.117'
x_Dist_Zilla:
perl:
version: '5.040001'
plugins:
-
class: Dist::Zilla::Plugin::Git::GatherDir
config:
Dist::Zilla::Plugin::GatherDir:
exclude_filename: []
exclude_match: []
include_dotfiles: 0
prefix: ''
prune_directory: []
root: .
Dist::Zilla::Plugin::Git::GatherDir:
include_untracked: 0
name: '@RJBS/Git::GatherDir'
version: '2.052'
-
class: Dist::Zilla::Plugin::CheckPrereqsIndexed
name: '@RJBS/CheckPrereqsIndexed'
version: '0.022'
-
class: Dist::Zilla::Plugin::CheckExtraTests
name: '@RJBS/CheckExtraTests'
version: '0.029'
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
Dist::Zilla::Plugin::PromptIfStale:
check_all_plugins: 0
check_all_prereqs: 0
modules:
- Dist::Zilla::PluginBundle::RJBS
phase: build
run_under_travis: 0
skip: []
name: '@RJBS/RJBS-Outdated'
version: '0.060'
-
class: Dist::Zilla::Plugin::PromptIfStale
config:
Dist::Zilla::Plugin::PromptIfStale:
check_all_plugins: 1
check_all_prereqs: 0
modules: []
phase: release
run_under_travis: 0
skip:
- Dist::Zilla::Plugin::RJBSMisc
name: '@RJBS/CPAN-Outdated'
version: '0.060'
-
class: Dist::Zilla::Plugin::PruneCruft
name: '@RJBS/@Filter/PruneCruft'
version: '6.037'
-
class: Dist::Zilla::Plugin::ManifestSkip
name: '@RJBS/@Filter/ManifestSkip'
version: '6.037'
-
class: Dist::Zilla::Plugin::MetaYAML
name: '@RJBS/@Filter/MetaYAML'
version: '6.037'
-
class: Dist::Zilla::Plugin::License
name: '@RJBS/@Filter/License'
version: '6.037'
-
class: Dist::Zilla::Plugin::Readme
name: '@RJBS/@Filter/Readme'
version: '6.037'
-
class: Dist::Zilla::Plugin::ExecDir
name: '@RJBS/@Filter/ExecDir'
version: '6.037'
-
class: Dist::Zilla::Plugin::ShareDir
name: '@RJBS/@Filter/ShareDir'
version: '6.037'
-
class: Dist::Zilla::Plugin::Manifest
name: '@RJBS/@Filter/Manifest'
version: '6.037'
-
class: Dist::Zilla::Plugin::TestRelease
name: '@RJBS/@Filter/TestRelease'
version: '6.037'
-
class: Dist::Zilla::Plugin::ConfirmRelease
name: '@RJBS/@Filter/ConfirmRelease'
version: '6.037'
-
class: Dist::Zilla::Plugin::UploadToCPAN
name: '@RJBS/@Filter/UploadToCPAN'
version: '6.037'
-
class: Dist::Zilla::Plugin::MakeMaker
config:
Dist::Zilla::Role::TestRunner:
default_jobs: 9
name: '@RJBS/MakeMaker'
version: '6.037'
-
class: Dist::Zilla::Plugin::AutoPrereqs
name: '@RJBS/AutoPrereqs'
version: '6.037'
-
class: Dist::Zilla::Plugin::Git::NextVersion
config:
Dist::Zilla::Plugin::Git::NextVersion:
first_version: '0.001'
version_by_branch: 1
version_regexp: (?^:^([0-9]+\.[0-9]+)$)
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
name: '@RJBS/Git::NextVersion'
version: '2.052'
-
class: Dist::Zilla::Plugin::PkgVersion
name: '@RJBS/PkgVersion'
version: '6.037'
-
class: Dist::Zilla::Plugin::MetaConfig
name: '@RJBS/MetaConfig'
version: '6.037'
-
class: Dist::Zilla::Plugin::MetaJSON
name: '@RJBS/MetaJSON'
version: '6.037'
-
class: Dist::Zilla::Plugin::NextRelease
name: '@RJBS/NextRelease'
version: '6.037'
-
class: Dist::Zilla::Plugin::Test::ChangesHasContent
name: '@RJBS/Test::ChangesHasContent'
version: '0.011'
-
class: Dist::Zilla::Plugin::PodSyntaxTests
name: '@RJBS/PodSyntaxTests'
version: '6.037'
-
class: Dist::Zilla::Plugin::Test::ReportPrereqs
name: '@RJBS/Test::ReportPrereqs'
version: '0.029'
-
class: Dist::Zilla::Plugin::Git::Remote::Check
name: '@RJBS/Git::Remote::Check'
version: 0.1.2
-
class: Dist::Zilla::Plugin::Test::Compile
config:
Dist::Zilla::Plugin::Test::Compile:
bail_out_on_fail: 1
fail_on_warning: author
fake_home: 0
filename: xt/author/00-compile.t
module_finder:
- ':InstallModules'
needs_display: 0
phase: develop
script_finder:
- ':PerlExecFiles'
skips: []
switch: []
name: '@RJBS/Test::Compile'
version: '2.059'
-
class: Dist::Zilla::Plugin::Prereqs
config:
Dist::Zilla::Plugin::Prereqs:
phase: test
type: requires
name: '@RJBS/TestMoreWithSubtests'
version: '6.037'
-
class: Dist::Zilla::Plugin::PodWeaver
config:
Dist::Zilla::Plugin::PodWeaver:
config_plugins:
- '@RJBS'
finder:
- ':InstallModules'
- ':PerlExecFiles'
plugins:
-
class: Pod::Weaver::Plugin::EnsurePod5
name: '@CorePrep/EnsurePod5'
version: '4.020'
-
class: Pod::Weaver::Plugin::H1Nester
name: '@CorePrep/H1Nester'
version: '4.020'
-
class: Pod::Weaver::Plugin::SingleEncoding
name: '@RJBS/SingleEncoding'
version: '4.020'
-
class: Pod::Weaver::Section::Name
name: '@RJBS/Name'
version: '4.020'
-
class: Pod::Weaver::Section::Version
name: '@RJBS/Version'
version: '4.020'
-
class: Pod::Weaver::Section::Region
name: '@RJBS/Prelude'
version: '4.020'
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Synopsis'
version: '4.020'
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Description'
version: '4.020'
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Overview'
version: '4.020'
-
class: Pod::Weaver::Section::Generic
name: '@RJBS/Stability'
version: '4.020'
-
class: Pod::Weaver::Section::GenerateSection
name: '@RJBS/PerlSupport'
version: '4.020'
-
class: Pod::Weaver::Section::Collect
name: Attributes
version: '4.020'
-
class: Pod::Weaver::Section::Collect
name: Methods
version: '4.020'
-
class: Pod::Weaver::Section::Collect
name: Functions
version: '4.020'
-
class: Pod::Weaver::Section::Leftovers
name: '@RJBS/Leftovers'
version: '4.020'
-
class: Pod::Weaver::Section::Region
name: '@RJBS/postlude'
version: '4.020'
-
class: Pod::Weaver::Section::Authors
name: '@RJBS/Authors'
version: '4.020'
-
class: Pod::Weaver::Section::Contributors
name: '@RJBS/Contributors'
version: '0.009'
-
class: Pod::Weaver::Section::Legal
name: '@RJBS/Legal'
version: '4.020'
-
class: Pod::Weaver::Plugin::Transformer
name: '@RJBS/List'
version: '4.020'
name: '@RJBS/PodWeaver'
version: '4.010'
-
class: Dist::Zilla::Plugin::RJBSMisc
name: '@RJBS/RJBSMisc'
version: '5.035'
-
class: Dist::Zilla::Plugin::GithubMeta
name: '@RJBS/GithubMeta'
version: '0.58'
-
class: Dist::Zilla::Plugin::Git::Check
config:
Dist::Zilla::Plugin::Git::Check:
untracked_files: die
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- Changes
- dist.ini
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
name: '@RJBS/@Git/Check'
version: '2.052'
-
class: Dist::Zilla::Plugin::Git::Commit
config:
Dist::Zilla::Plugin::Git::Commit:
add_files_in: []
commit_msg: v%V%n%n%c
signoff: 0
Dist::Zilla::Role::Git::DirtyFiles:
allow_dirty:
- Changes
- dist.ini
allow_dirty_match: []
changelog: Changes
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
name: '@RJBS/@Git/Commit'
version: '2.052'
-
class: Dist::Zilla::Plugin::Git::Tag
config:
Dist::Zilla::Plugin::Git::Tag:
branch: ~
changelog: Changes
signed: 0
tag: '0.117'
tag_format: '%v'
tag_message: v%V
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
Dist::Zilla::Role::Git::StringFormatter:
time_zone: local
name: '@RJBS/@Git/Tag'
version: '2.052'
-
class: Dist::Zilla::Plugin::Git::Push
config:
Dist::Zilla::Plugin::Git::Push:
push_to:
- 'github :'
remotes_must_exist: 0
Dist::Zilla::Role::Git::Repo:
git_version: '2.50.1 (Apple Git-155)'
repo_root: .
name: '@RJBS/@Git/Push'
version: '2.052'
-
class: Dist::Zilla::Plugin::Git::Contributors
config:
Dist::Zilla::Plugin::Git::Contributors:
git_version: '2.50.1 (Apple Git-155)'
include_authors: 0
include_releaser: 1
order_by: name
paths: []
name: '@RJBS/Git::Contributors'
version: '0.038'
-
class: Dist::Zilla::Plugin::Breaks
name: Breaks
version: '0.005'
-
class: Dist::Zilla::Plugin::Test::CheckBreaks
config:
Dist::Zilla::Plugin::Test::CheckBreaks:
conflicts_module:
- Moose::Conflicts
no_forced_deps: 0
Dist::Zilla::Role::ModuleMetadata:
Module::Metadata: '1.000038'
version: '0.006'
name: Test::CheckBreaks
version: '0.020'
-
class: Dist::Zilla::Plugin::Prereqs
config:
Dist::Zilla::Plugin::Prereqs:
phase: configure
type: requires
name: ConfigureRequires
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':InstallModules'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':IncModules'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':TestFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExtraTestFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ExecFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':PerlExecFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':ShareFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':MainModule'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':AllFiles'
version: '6.037'
-
class: Dist::Zilla::Plugin::FinderCode
name: ':NoFiles'
version: '6.037'
zilla:
class: Dist::Zilla::Dist::Builder
config:
is_trial: 0
version: '6.037'
x_breaks:
MooseX::Getopt: '< 0.66'
x_contributors:
- "Arthur Axel 'fREW' Schmidt "
- 'Dave Rolsky '
- 'Diab Jerius '
- 'Hans Dieter Pearcey '
- 'Harley Pig '
- 'hdp@cpan.org '
- 'Karen Etheridge '
- 'Michael McClimon '
- 'Niels Thykier '
- 'Olaf Alders '
- 'Ricardo Signes '
- 'Roman Hubacek '
- 'Smylers '
- 'Thomas Neumann '
- 'zhouzhen1 '
x_generated_by_perl: v5.40.1
x_rjbs_perl_window: long-term
x_serialization_backend: 'YAML::Tiny version 1.76'
x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
MANIFEST 100644 000765 000024 702 15145670555 16572 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.037
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
eg/demo-options
lib/Getopt/Long/Descriptive.pm
lib/Getopt/Long/Descriptive/Opts.pm
lib/Getopt/Long/Descriptive/Usage.pm
t/00-report-prereqs.dd
t/00-report-prereqs.t
t/descriptive.t
t/shortcircuit.t
t/zzz-check-breaks.t
xt/author/00-compile.t
xt/author/pod-syntax.t
xt/release/changes_has_content.t
META.json 100644 000765 000024 52655 15145670555 17140 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 {
"abstract" : "Getopt::Long, but simpler and more powerful",
"author" : [
"Hans Dieter Pearcey ",
"Ricardo Signes "
],
"dynamic_config" : 0,
"generated_by" : "Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150010",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : 2
},
"name" : "Getopt-Long-Descriptive",
"prereqs" : {
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.78"
}
},
"develop" : {
"requires" : {
"Encode" : "0",
"File::Spec" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
"Test::More" : "0.94",
"Test::Pod" : "1.41"
}
},
"runtime" : {
"requires" : {
"Carp" : "0",
"File::Basename" : "0",
"Getopt::Long" : "2.55",
"List::Util" : "0",
"Params::Validate" : "0.97",
"Scalar::Util" : "0",
"Sub::Exporter" : "0.972",
"Sub::Exporter::Util" : "0",
"overload" : "0",
"perl" : "5.012",
"strict" : "0",
"warnings" : "0"
}
},
"test" : {
"recommends" : {
"CPAN::Meta" : "2.120900"
},
"requires" : {
"CPAN::Meta::Check" : "0.011",
"CPAN::Meta::Requirements" : "0",
"ExtUtils::MakeMaker" : "0",
"File::Spec" : "0",
"Term::ANSIColor" : "0",
"Test::Fatal" : "0",
"Test::More" : "0.96",
"Test::Warnings" : "0.005"
}
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "https://github.com/rjbs/Getopt-Long-Descriptive/issues"
},
"homepage" : "https://github.com/rjbs/Getopt-Long-Descriptive",
"repository" : {
"type" : "git",
"url" : "https://github.com/rjbs/Getopt-Long-Descriptive.git",
"web" : "https://github.com/rjbs/Getopt-Long-Descriptive"
}
},
"version" : "0.117",
"x_Dist_Zilla" : {
"perl" : {
"version" : "5.040001"
},
"plugins" : [
{
"class" : "Dist::Zilla::Plugin::Git::GatherDir",
"config" : {
"Dist::Zilla::Plugin::GatherDir" : {
"exclude_filename" : [],
"exclude_match" : [],
"include_dotfiles" : 0,
"prefix" : "",
"prune_directory" : [],
"root" : "."
},
"Dist::Zilla::Plugin::Git::GatherDir" : {
"include_untracked" : 0
}
},
"name" : "@RJBS/Git::GatherDir",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed",
"name" : "@RJBS/CheckPrereqsIndexed",
"version" : "0.022"
},
{
"class" : "Dist::Zilla::Plugin::CheckExtraTests",
"name" : "@RJBS/CheckExtraTests",
"version" : "0.029"
},
{
"class" : "Dist::Zilla::Plugin::PromptIfStale",
"config" : {
"Dist::Zilla::Plugin::PromptIfStale" : {
"check_all_plugins" : 0,
"check_all_prereqs" : 0,
"modules" : [
"Dist::Zilla::PluginBundle::RJBS"
],
"phase" : "build",
"run_under_travis" : 0,
"skip" : []
}
},
"name" : "@RJBS/RJBS-Outdated",
"version" : "0.060"
},
{
"class" : "Dist::Zilla::Plugin::PromptIfStale",
"config" : {
"Dist::Zilla::Plugin::PromptIfStale" : {
"check_all_plugins" : 1,
"check_all_prereqs" : 0,
"modules" : [],
"phase" : "release",
"run_under_travis" : 0,
"skip" : [
"Dist::Zilla::Plugin::RJBSMisc"
]
}
},
"name" : "@RJBS/CPAN-Outdated",
"version" : "0.060"
},
{
"class" : "Dist::Zilla::Plugin::PruneCruft",
"name" : "@RJBS/@Filter/PruneCruft",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::ManifestSkip",
"name" : "@RJBS/@Filter/ManifestSkip",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::MetaYAML",
"name" : "@RJBS/@Filter/MetaYAML",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::License",
"name" : "@RJBS/@Filter/License",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Readme",
"name" : "@RJBS/@Filter/Readme",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::ExecDir",
"name" : "@RJBS/@Filter/ExecDir",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::ShareDir",
"name" : "@RJBS/@Filter/ShareDir",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Manifest",
"name" : "@RJBS/@Filter/Manifest",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::TestRelease",
"name" : "@RJBS/@Filter/TestRelease",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::ConfirmRelease",
"name" : "@RJBS/@Filter/ConfirmRelease",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::UploadToCPAN",
"name" : "@RJBS/@Filter/UploadToCPAN",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::MakeMaker",
"config" : {
"Dist::Zilla::Role::TestRunner" : {
"default_jobs" : 9
}
},
"name" : "@RJBS/MakeMaker",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::AutoPrereqs",
"name" : "@RJBS/AutoPrereqs",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Git::NextVersion",
"config" : {
"Dist::Zilla::Plugin::Git::NextVersion" : {
"first_version" : "0.001",
"version_by_branch" : 1,
"version_regexp" : "(?^:^([0-9]+\\.[0-9]+)$)"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
}
},
"name" : "@RJBS/Git::NextVersion",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::PkgVersion",
"name" : "@RJBS/PkgVersion",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::MetaConfig",
"name" : "@RJBS/MetaConfig",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::MetaJSON",
"name" : "@RJBS/MetaJSON",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::NextRelease",
"name" : "@RJBS/NextRelease",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Test::ChangesHasContent",
"name" : "@RJBS/Test::ChangesHasContent",
"version" : "0.011"
},
{
"class" : "Dist::Zilla::Plugin::PodSyntaxTests",
"name" : "@RJBS/PodSyntaxTests",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::Test::ReportPrereqs",
"name" : "@RJBS/Test::ReportPrereqs",
"version" : "0.029"
},
{
"class" : "Dist::Zilla::Plugin::Git::Remote::Check",
"name" : "@RJBS/Git::Remote::Check",
"version" : "0.1.2"
},
{
"class" : "Dist::Zilla::Plugin::Test::Compile",
"config" : {
"Dist::Zilla::Plugin::Test::Compile" : {
"bail_out_on_fail" : 1,
"fail_on_warning" : "author",
"fake_home" : 0,
"filename" : "xt/author/00-compile.t",
"module_finder" : [
":InstallModules"
],
"needs_display" : 0,
"phase" : "develop",
"script_finder" : [
":PerlExecFiles"
],
"skips" : [],
"switch" : []
}
},
"name" : "@RJBS/Test::Compile",
"version" : "2.059"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
"config" : {
"Dist::Zilla::Plugin::Prereqs" : {
"phase" : "test",
"type" : "requires"
}
},
"name" : "@RJBS/TestMoreWithSubtests",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::PodWeaver",
"config" : {
"Dist::Zilla::Plugin::PodWeaver" : {
"config_plugins" : [
"@RJBS"
],
"finder" : [
":InstallModules",
":PerlExecFiles"
],
"plugins" : [
{
"class" : "Pod::Weaver::Plugin::EnsurePod5",
"name" : "@CorePrep/EnsurePod5",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Plugin::H1Nester",
"name" : "@CorePrep/H1Nester",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Plugin::SingleEncoding",
"name" : "@RJBS/SingleEncoding",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Name",
"name" : "@RJBS/Name",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Version",
"name" : "@RJBS/Version",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Region",
"name" : "@RJBS/Prelude",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "@RJBS/Synopsis",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "@RJBS/Description",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "@RJBS/Overview",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Generic",
"name" : "@RJBS/Stability",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::GenerateSection",
"name" : "@RJBS/PerlSupport",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "Attributes",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "Methods",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Collect",
"name" : "Functions",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Leftovers",
"name" : "@RJBS/Leftovers",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Region",
"name" : "@RJBS/postlude",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Authors",
"name" : "@RJBS/Authors",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Section::Contributors",
"name" : "@RJBS/Contributors",
"version" : "0.009"
},
{
"class" : "Pod::Weaver::Section::Legal",
"name" : "@RJBS/Legal",
"version" : "4.020"
},
{
"class" : "Pod::Weaver::Plugin::Transformer",
"name" : "@RJBS/List",
"version" : "4.020"
}
]
}
},
"name" : "@RJBS/PodWeaver",
"version" : "4.010"
},
{
"class" : "Dist::Zilla::Plugin::RJBSMisc",
"name" : "@RJBS/RJBSMisc",
"version" : "5.035"
},
{
"class" : "Dist::Zilla::Plugin::GithubMeta",
"name" : "@RJBS/GithubMeta",
"version" : "0.58"
},
{
"class" : "Dist::Zilla::Plugin::Git::Check",
"config" : {
"Dist::Zilla::Plugin::Git::Check" : {
"untracked_files" : "die"
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
"Changes",
"dist.ini"
],
"allow_dirty_match" : [],
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
}
},
"name" : "@RJBS/@Git/Check",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::Git::Commit",
"config" : {
"Dist::Zilla::Plugin::Git::Commit" : {
"add_files_in" : [],
"commit_msg" : "v%V%n%n%c",
"signoff" : 0
},
"Dist::Zilla::Role::Git::DirtyFiles" : {
"allow_dirty" : [
"Changes",
"dist.ini"
],
"allow_dirty_match" : [],
"changelog" : "Changes"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"time_zone" : "local"
}
},
"name" : "@RJBS/@Git/Commit",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::Git::Tag",
"config" : {
"Dist::Zilla::Plugin::Git::Tag" : {
"branch" : null,
"changelog" : "Changes",
"signed" : 0,
"tag" : "0.117",
"tag_format" : "%v",
"tag_message" : "v%V"
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
},
"Dist::Zilla::Role::Git::StringFormatter" : {
"time_zone" : "local"
}
},
"name" : "@RJBS/@Git/Tag",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::Git::Push",
"config" : {
"Dist::Zilla::Plugin::Git::Push" : {
"push_to" : [
"github :"
],
"remotes_must_exist" : 0
},
"Dist::Zilla::Role::Git::Repo" : {
"git_version" : "2.50.1 (Apple Git-155)",
"repo_root" : "."
}
},
"name" : "@RJBS/@Git/Push",
"version" : "2.052"
},
{
"class" : "Dist::Zilla::Plugin::Git::Contributors",
"config" : {
"Dist::Zilla::Plugin::Git::Contributors" : {
"git_version" : "2.50.1 (Apple Git-155)",
"include_authors" : 0,
"include_releaser" : 1,
"order_by" : "name",
"paths" : []
}
},
"name" : "@RJBS/Git::Contributors",
"version" : "0.038"
},
{
"class" : "Dist::Zilla::Plugin::Breaks",
"name" : "Breaks",
"version" : "0.005"
},
{
"class" : "Dist::Zilla::Plugin::Test::CheckBreaks",
"config" : {
"Dist::Zilla::Plugin::Test::CheckBreaks" : {
"conflicts_module" : [
"Moose::Conflicts"
],
"no_forced_deps" : 0
},
"Dist::Zilla::Role::ModuleMetadata" : {
"Module::Metadata" : "1.000038",
"version" : "0.006"
}
},
"name" : "Test::CheckBreaks",
"version" : "0.020"
},
{
"class" : "Dist::Zilla::Plugin::Prereqs",
"config" : {
"Dist::Zilla::Plugin::Prereqs" : {
"phase" : "configure",
"type" : "requires"
}
},
"name" : "ConfigureRequires",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":InstallModules",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":IncModules",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":TestFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExtraTestFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ExecFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":PerlExecFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":ShareFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":MainModule",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":AllFiles",
"version" : "6.037"
},
{
"class" : "Dist::Zilla::Plugin::FinderCode",
"name" : ":NoFiles",
"version" : "6.037"
}
],
"zilla" : {
"class" : "Dist::Zilla::Dist::Builder",
"config" : {
"is_trial" : 0
},
"version" : "6.037"
}
},
"x_breaks" : {
"MooseX::Getopt" : "< 0.66"
},
"x_contributors" : [
"Arthur Axel 'fREW' Schmidt ",
"Dave Rolsky ",
"Diab Jerius ",
"Hans Dieter Pearcey ",
"Harley Pig ",
"hdp@cpan.org ",
"Karen Etheridge ",
"Michael McClimon ",
"Niels Thykier ",
"Olaf Alders ",
"Ricardo Signes ",
"Roman Hubacek ",
"Smylers ",
"Thomas Neumann ",
"zhouzhen1 "
],
"x_generated_by_perl" : "v5.40.1",
"x_rjbs_perl_window" : "long-term",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.40",
"x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later"
}
Makefile.PL 100644 000765 000024 3766 15145670555 17450 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.037
use strict;
use warnings;
use 5.012;
use ExtUtils::MakeMaker 6.78;
my %WriteMakefileArgs = (
"ABSTRACT" => "Getopt::Long, but simpler and more powerful",
"AUTHOR" => "Hans Dieter Pearcey , Ricardo Signes ",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => "6.78"
},
"DISTNAME" => "Getopt-Long-Descriptive",
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.012",
"NAME" => "Getopt::Long::Descriptive",
"PREREQ_PM" => {
"Carp" => 0,
"File::Basename" => 0,
"Getopt::Long" => "2.55",
"List::Util" => 0,
"Params::Validate" => "0.97",
"Scalar::Util" => 0,
"Sub::Exporter" => "0.972",
"Sub::Exporter::Util" => 0,
"overload" => 0,
"strict" => 0,
"warnings" => 0
},
"TEST_REQUIRES" => {
"CPAN::Meta::Check" => "0.011",
"CPAN::Meta::Requirements" => 0,
"ExtUtils::MakeMaker" => 0,
"File::Spec" => 0,
"Term::ANSIColor" => 0,
"Test::Fatal" => 0,
"Test::More" => "0.96",
"Test::Warnings" => "0.005"
},
"VERSION" => "0.117",
"test" => {
"TESTS" => "t/*.t"
}
);
my %FallbackPrereqs = (
"CPAN::Meta::Check" => "0.011",
"CPAN::Meta::Requirements" => 0,
"Carp" => 0,
"ExtUtils::MakeMaker" => 0,
"File::Basename" => 0,
"File::Spec" => 0,
"Getopt::Long" => "2.55",
"List::Util" => 0,
"Params::Validate" => "0.97",
"Scalar::Util" => 0,
"Sub::Exporter" => "0.972",
"Sub::Exporter::Util" => 0,
"Term::ANSIColor" => 0,
"Test::Fatal" => 0,
"Test::More" => "0.96",
"Test::Warnings" => "0.005",
"overload" => 0,
"strict" => 0,
"warnings" => 0
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
eg 000755 000765 000024 0 15145670555 15715 5 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 demo-options 100755 000765 000024 1247 15145670555 20424 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/eg #!/usr/bin/env perl
use v5.20.0;
use warnings;
use lib 'lib';
use Getopt::Long::Descriptive;
# This program here is to spit out usage so you can see what things look like.
# It will change over time to keep demonstrating stuff. Enjoy.
my ($opt, $usage) = describe_options(
'%c %o',
[ "simple", "the simplest option" ],
[ "alias|aka", "something with two names" ],
[ "short|s", "something with a short name" ],
[ "longdesc", "The description for this option is relatively long, okay?" ],
[], # a blank!
[ "A sentence of text that runs just about the whole width of my terminal." ],
[],
[ "bananas|b!", "an on/off option" ],
);
print $usage->text;
t 000755 000765 000024 0 15145670555 15565 5 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117 descriptive.t 100644 000765 000024 30334 15145670555 20456 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/t #!perl
use strict;
use warnings;
# Set this before loading GLD so its prog_name returns a known string.
BEGIN { $0 = 'test-program' }
use Getopt::Long::Descriptive;
use Test::More;
# test constraints:
# (look at P::V for names, too)
# required => 1
# depends => [...]
# precludes => [...]
# sugar for only_one_of and all_or_none
sub is_opt {
my ($argv, $specs, $expect, $desc) = @_;
local @ARGV = @$argv;
local $Test::Builder::Level = $Test::Builder::Level + 1;
my $ok = eval {
local $Test::Builder::Level = $Test::Builder::Level + 1;
my ($opt, $usage) = describe_options(
"test %o",
@$specs,
);
is_deeply(
$opt,
$expect,
$desc,
);
for my $key (keys %$expect) {
is($opt->$key, $expect->{$key}, "...->$key");
}
1
};
unless ($ok) {
my $error = $@;
chomp $error;
if (ref($expect) eq 'Regexp') {
like($error, $expect, $desc);
} else {
# auto-fail
is($error, "", "$desc: $error");
}
}
}
sub is_hidden {
my ($specs, $cmd, $text) = @_;
eval {
local @ARGV;
my ($opt, $usage) = describe_options(
"test %o",
@$specs,
);
like(
$usage->text,
$cmd,
"hidden option in usage command",
);
unlike(
$usage->text,
$text,
"hidden option description",
);
};
if ($@) {
chomp($@);
is($@, "", "hidden: $@");
ok(0);
}
}
is_opt(
[ ],
[ [ "foo-bar=i", "foo integer", { default => 17 } ] ],
{ foo_bar => 17 },
"default foo_bar with no short option name",
);
# test hidden
is_hidden(
[
[ "foo|f", "a foo option" ],
[ "bar|b", "a bar option", { hidden => 1 } ],
],
qr/test \[-f\] \[long options\.\.\.\]/i,
qr/a bar option/,
);
is_opt(
[ '--nora' ],
[ [ "nora", "Invisible Nora", { hidden => 1 } ] ],
{ nora => 1 },
"",
);
### tests for one_of
my $foobar = [
[ 'foo' => 'a foo option' ],
[ 'bar' => 'a bar option' ],
];
is_opt(
[ ],
[
[
mode => $foobar, { default => 'foo' },
],
],
{ mode => 'foo' },
"basic usage, with default",
);
is_opt(
[ '--bar' ],
[
[
mode => $foobar,
],
],
{ bar => 1, mode => 'bar' },
"basic usage, passed-in",
);
# implies should override default, github #12
is_opt(
[ '--beta' ],
[
[ alfa => 'default off', { default => 0 } ],
[ beta => 'implies alfa', { default => 0, implies => 'alfa' } ],
],
{ alfa => 1, beta => 1 },
"implies A overrides A's default",
);
# implicit hidden syntax
is_hidden(
[ [ mode => [] ] ],
qr/test\s*\n/i,
qr/mode/,
);
is_opt(
[ '--foo', '--bar' ],
[ [ mode => $foobar ] ],
#qr/\Qonly one 'mode' option (foo, bar)\E/,
qr/options conflict/,
"only one 'mode' option",
);
is_opt(
[ '--no-bar', '--baz' ],
[
[
mode => [
[ foo => 'a foo option' ],
[ 'bar!' => 'a negatable bar option' ],
],
],
[ 'baz!' => 'a negatable baz option' ],
],
{ bar => 0, mode => 'bar', baz => 1 },
"negatable usage",
);
is_opt(
[ ],
[
[ req => 'a required option' => {
required => 1
} ],
],
qr/mandatory parameter/i,
"required option -- help text"
);
is_opt(
[ ],
[
[ unreq => 'an unrequired option' => {
required => 0
} ],
],
{},
"an unrequired option"
);
{
local @ARGV;
my ($opt, $usage) = describe_options(
"%c %o",
[ foo => "a foo option" ],
[],
['bar options:'],
[ bar => "a bar option" ],
);
like(
$usage->text,
qr/foo option\n[\t\x20]*\n bar options:\n\s+--bar/,
"spacer and non-option description found",
);
local $SIG{__WARN__} = sub {}; # we know that this will warn; don't care
like(
$usage->(1),
qr/foo option\n[\t\x20]*\n bar options:\n\s+--bar/,
"CODEISH: spacer and non-option description found",
);
}
{
local @ARGV;
my ($opt, $usage) = describe_options(
"%c %o",
[ foo => "a foo option" ],
[],
[\"bar options:\n -> they are cool"],
[ bar => "a bar option" ],
);
like(
$usage->text,
qr/foo option\n[\t\x20]*\nbar options:\n -> they are cool\n\s+--bar/,
"verbatim spacer found",
);
local $SIG{__WARN__} = sub {}; # we know that this will warn; don't care
like(
$usage->(1),
qr/foo option\n[\t\x20]*\nbar options:\n -> they are cool\n\s+--bar/,
"CODEISH: spacer and non-option description found",
);
}
{
local @ARGV;
my ($opt, $usage) = describe_options(
"%c %o",
[ 'foo' => "foo option" ],
[ 'bar|b' => "bar option" ],
[ 'string|s=s' => "string value" ],
[ 'ostring|S:s' => "optional string value" ],
[ 'list|l=s@' => "list of strings" ],
[ 'hash|h=s%' => "hash values" ],
[ 'optional|o!' => "optional" ],
[ 'increment|i+' => "incremental option" ],
);
like(
$usage->text,
qr/\[-bhiloSs\]/,
"short options",
);
}
{
local @ARGV;
my ($opt, $usage) = describe_options(
"%c %o",
[ 'string|s=s' => "string value" ],
[ 'ostring|S:s' => "optional string value" ],
[ 'list|l=s@' => "list of strings" ],
[ 'hash|h=s%' => "hash values" ],
[ 'optional|o!' => "optional boolean" ],
[ 'increment|i+' => "incremental option" ],
);
my $usage_text = $usage->text;
like(
$usage_text,
qr/--string STR \(or -s\)\s+string value/,
"Spec =s gets an STR in usage output",
);
like(
$usage_text,
qr/--ostring\[=STR\] \(or -S\)\s+optional string value/,
"Spec :s gets an STR in usage output",
);
like(
$usage_text,
qr/--list STR\Q...\E \(or -l\)\s+list of strings/,
"Spec =s@ gets an STR... in usage output",
);
like(
$usage_text,
qr/--hash KEY=STR\Q...\E \(or -h\)\s+hash values/,
"Spec =s% gets an KEY=STR... in usage output",
);
like(
$usage_text,
qr/--\[no-\]optional \(or -o\)\s+optional boolean/,
"Spec ! gets a [no-] in usage output",
);
}
{
local @ARGV = qw(--foo FOO --baz BAZ);
my ($c_opt, $usage) = describe_options(
"%c %o",
[ "foo=s", '' ],
[ "bar=s", '', { default => 'BAR' } ],
[ "baz=s", '', { default => 'BAZ' } ],
);
my $s_opt = $c_opt->_specified_opts;
my $C_opt = $s_opt->_complete_opts;
is($c_opt->foo, 'FOO', 'c_opt->foo is FOO');
is($C_opt->foo, 'FOO', 'C_opt->foo is FOO');
is($s_opt->foo, 'FOO', 's_opt->foo is FOO');
is($c_opt->bar, 'BAR', 'c_opt->foo is BAR');
is($C_opt->bar, 'BAR', 'C_opt->foo is BAR');
is($s_opt->bar, undef, 's_opt->foo is undef');
is($c_opt->baz, 'BAZ', 'c_opt->foo is BAZ');
is($C_opt->baz, 'BAZ', 'C_opt->foo is BAZ');
is($s_opt->baz, 'BAZ', 's_opt->foo is BAZ');
}
{
local @ARGV = qw(--foo);
my ($opt, $usage) = describe_options(
"%c %o",
[ "foo", '' ],
[ "bar", '' ],
);
is( $opt->{foo}, 1, "empty-but-present description is ok" );
is( $opt->foo, 1, "empty-but-present description is ok" );
is( $opt->{bar}, undef, "entry not given is undef (exists? no guarantee)" );
is( $opt->bar, undef, "entry not given is undef (as method)");
}
{
local @ARGV = qw(--get);
my ($opt, $usage) = describe_options(
"%c %o",
[ "mode" => hidden => { one_of => [
[ "get" => "get the value" ],
[ "set" => "set the value" ],
] } ],
);
is( $opt->{get}, 1, "one_of provided value (as hash key)" );
is( $opt->get, 1, "one_of provided value (as method)" );
is( $opt->{set}, undef, "one_of entry not given is undef (as hash key)" );
is( $opt->set, undef, "one_of entry not given is undef (as method)");
}
{
local @ARGV = qw(--foo-bar);
my ($opt) = describe_options(
"%c %o",
[ "foo:s", "foo option" ],
[ "foo-bar", "foo-bar option", { implies => 'foo' } ],
);
is_deeply($opt, { foo => 1, foo_bar => 1 },
"ok to imply option with optional argument");
is($opt->foo_bar, 1, 'given value (checked with method)');
is($opt->foo, 1, 'implied value (checked with method)');
}
{
local @ARGV;
local $Getopt::Long::Descriptive::TERM_WIDTH = 80;
my ($opt, $usage) = describe_options(
"test %o",
[ foo => "a foo option" ],
[ bar => "a bar option" ],
[ baz => "a baz option with a very long description."
. " It just goes on for a really long time."
. " This allows us to test line wrapping and"
. " make sure the output always looks spiffy" ],
[], # blank line
[ "We can do the same thing with a long spacer. This option line is a"
. " spacer and it will be longer than the 78 column line that we use by"
. " default." ],
[], # blank line
[ xyz => "an xyz option" ],
);
my $expect = <<"EOO";
test [long options...]
--foo a foo option
--bar a bar option
--baz a baz option with a very long description. It just goes on for
a really long time. This allows us to test line wrapping and
make sure the output always looks spiffy
We can do the same thing with a long spacer. This option line is a
spacer and it will be longer than the 78 column line that we use by
default.
--xyz an xyz option
EOO
is($usage->text, $expect, 'long option description is wrapped cleanly');
}
{
local @ARGV;
local $Getopt::Long::Descriptive::TERM_WIDTH = 80;
# We're testing, here, that if we "forget" the usual "%c %o" style format,
# its assumed.
my ($opt, $usage) = describe_options(
[ foo => "a foo option" ],
);
my $expect = <<"EOO";
test-program [long options...]
--foo a foo option
EOO
is($usage->text, $expect, 'long option description is wrapped cleanly');
}
{
my @gld_args = ('%c %o', [ 'exit!', 'hell is other getopts' ]);
my @test = (
# (expected $opt->exit) then (@ARGV)
[ undef, ],
[ 1, '--exit' ],
[ 0, '--no-exit' ],
);
for my $test (@test) {
my $want = shift @$test;
local @ARGV = @$test;
my ($opt, $usage) = describe_options(@gld_args);
is(scalar $opt->exit, $want, "(@$test) for exit!");
}
}
{
local @ARGV;
my ($opt, $usage) = describe_options(
"%c %o",
[ foo => "x" x 80 ],
);
local $@;
local $SIG{ALRM} = sub { die "ALRM\n" };
eval {
alarm(2);
like($usage->text, qr/@{["x" x 80]}/, "handled unwrappable description");
alarm(0);
};
is($@, '', "no error in eval");
}
subtest "descriptions for option value types" => sub {
my $p = \&Getopt::Long::Descriptive::Usage::_parse_assignment;
is ($p->('=s'), ' STR', 'string');
is ($p->('=i'), ' INT', 'int (i)');
is ($p->('=o'), ' INT', 'int (o)');
is ($p->('=f'), ' NUM', 'float');
is ($p->(':s'), '[=STR]', 'optional string');
is ($p->(':i'), '[=INT]', 'optional int (i)');
is ($p->(':+'), '[=INT]', 'optional int (+)');
is ($p->(':2'), '[=INT]', 'optional int (2)');
is ($p->(':o'), '[=INT]', 'optional int (o)');
is ($p->(':f'), '[=NUM]', 'optional float');
is ($p->('=s@'), ' STR...', 'strings');
is ($p->('=i@'), ' INT...', 'ints (i)');
is ($p->('=o@'), ' INT...', 'ints (o)');
is ($p->('=f@'), ' NUM...', 'floats');
is ($p->('=s%'), ' KEY=STR...', 'string maps');
is ($p->('=i%'), ' KEY=INT...', 'int maps (i)');
is ($p->('=o%'), ' KEY=INT...', 'int maps (o)');
is ($p->('=f%'), ' KEY=NUM...', 'float maps');
};
{
# Asking Getopt::Long::Descriptive to use a specific Getopt::Long config
# should not alter the global state after the describe_options(...) call has
# returned!
ok(!$Getopt::Long::gnu_compat, "Getopt::Long::gnu_compat starts life false");
is_opt(
[ ],
[
[ "foo-bar=i", "foo integer", { default => 17 } ],
{ getopt_conf => [ 'gnu_compat' ] },
],
{ foo_bar => 17 },
"default foo_bar with no short option name",
);
ok(!$Getopt::Long::gnu_compat, "Getopt::Long::gnu_compat still false after getopt");
}
subtest "completion skips non-option specs" => sub {
my @specs = (
[ 'foo', 'a foo option' ],
[ 'This is just text' ], # single plain-string entry
[], # blank spacer
[ \'verbatim text' ], # scalar-ref verbatim entry
[ 'bar', 'a bar option' ],
);
my $bash = Getopt::Long::Descriptive::_completion_for_bash(@specs);
is($bash->{flags}, '--foo --bar', 'bash completion flags omit non-option specs');
my @zsh = Getopt::Long::Descriptive::_completion_for_zsh(@specs);
is(scalar @zsh, 2, 'zsh completion has one entry per real option');
};
done_testing;
shortcircuit.t 100644 000765 000024 3153 15145670555 20636 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/t #!perl
use strict;
use warnings;
use Test::More;
use Test::Warnings 0.005 qw[ warning ];
use Test::Fatal;
use Getopt::Long::Descriptive;
my $nreq = 6;
my @reqs = map { "--req$_" } 1 .. $nreq;
sub _args {
"test %o",
# load with extra required to make sure
# sorting on shortcircuit attribute works;
(map { [ "req$_", 'required', { required => 1 } ] } 1 .. $nreq),
[ 'help', 'help', { shortcircuit => 1, @_ } ],
}
like(
exception { describe_options( _args() ) },
qr/required/,
'no req: error',
);
like(
warning {
local @ARGV = @reqs;
describe_options( _args( default => 1 ) );
},
qr/'default' does not make sense for shortcircuit/,
'shortcircuit + default'
);
SKIP: {
my $opt;
is(
exception {
local @ARGV = @reqs;
( $opt ) = describe_options( _args() );
},
undef,
'req: no error'
) or skip( 'no object due to failure', 1 );
ok( defined $opt->req1 && $opt->req1 == 1, 'req: req1 specified' );
}
SKIP: {
my $opt;
is(
exception {
local @ARGV = qw[ --help ];
( $opt ) = describe_options( _args() );
},
undef,
'help: no error'
) or skip( 'no object due to failure', 2 );
is( $opt->help, 1, 'help: help flag' );
is( scalar keys %{$opt}, 1, 'help: only help' );
}
SKIP: {
my ( $w, $opt );
is(
exception {
local @ARGV = qw[ --help ];
( $opt ) = describe_options( _args( @reqs ) );
},
undef,
'help + req: no error'
) or skip( 'no object due to failure', 2 );
is( $opt->help, 1, 'help + req: help flag' );
is( scalar keys %{$opt}, 1, 'help + req: only help' );
}
done_testing;
zzz-check-breaks.t 100644 000765 000024 2037 15145670555 21271 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/t use strict;
use warnings;
# this test was generated with Dist::Zilla::Plugin::Test::CheckBreaks 0.020
use Test::More tests => 2;
use Term::ANSIColor 'colored';
SKIP: {
eval { +require Moose::Conflicts; Moose::Conflicts->check_conflicts };
skip('no Moose::Conflicts module found', 1) if not $INC{'Moose/Conflicts.pm'};
diag $@ if $@;
pass 'conflicts checked via Moose::Conflicts';
}
# this data duplicates x_breaks in META.json
my $breaks = {
"MooseX::Getopt" => "< 0.66"
};
use CPAN::Meta::Requirements;
use CPAN::Meta::Check 0.011;
my $reqs = CPAN::Meta::Requirements->new;
$reqs->add_string_requirement($_, $breaks->{$_}) foreach keys %$breaks;
our $result = CPAN::Meta::Check::check_requirements($reqs, 'conflicts');
if (my @breaks = grep defined $result->{$_}, keys %$result) {
diag colored('Breakages found with Getopt-Long-Descriptive:', 'yellow');
diag colored("$result->{$_}", 'yellow') for sort @breaks;
diag "\n", colored('You should now update these modules!', 'yellow');
}
pass 'checked x_breaks data';
00-report-prereqs.t 100644 000765 000024 13601 15145670555 21342 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/t #!perl
use strict;
use warnings;
# This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.029
use Test::More tests => 1;
use ExtUtils::MakeMaker;
use File::Spec;
# from $version::LAX
my $lax_version_re =
qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
|
(?:\.[0-9]+) (?:_[0-9]+)?
) | (?:
v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
|
(?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)?
)
)/x;
# hide optional CPAN::Meta modules from prereq scanner
# and check if they are available
my $cpan_meta = "CPAN::Meta";
my $cpan_meta_pre = "CPAN::Meta::Prereqs";
my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic
# Verify requirements?
my $DO_VERIFY_PREREQS = 1;
sub _max {
my $max = shift;
$max = ( $_ > $max ) ? $_ : $max for @_;
return $max;
}
sub _merge_prereqs {
my ($collector, $prereqs) = @_;
# CPAN::Meta::Prereqs object
if (ref $collector eq $cpan_meta_pre) {
return $collector->with_merged_prereqs(
CPAN::Meta::Prereqs->new( $prereqs )
);
}
# Raw hashrefs
for my $phase ( keys %$prereqs ) {
for my $type ( keys %{ $prereqs->{$phase} } ) {
for my $module ( keys %{ $prereqs->{$phase}{$type} } ) {
$collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module};
}
}
}
return $collector;
}
my @include = qw(
);
my @exclude = qw(
);
# Add static prereqs to the included modules list
my $static_prereqs = do './t/00-report-prereqs.dd';
# Merge all prereqs (either with ::Prereqs or a hashref)
my $full_prereqs = _merge_prereqs(
( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ),
$static_prereqs
);
# Add dynamic prereqs to the included modules list (if we can)
my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
my $cpan_meta_error;
if ( $source && $HAS_CPAN_META
&& (my $meta = eval { CPAN::Meta->load_file($source) } )
) {
$full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
}
else {
$cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source)
$source = 'static metadata';
}
my @full_reports;
my @dep_errors;
my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
# Add static includes into a fake section
for my $mod (@include) {
$req_hash->{other}{modules}{$mod} = 0;
}
for my $phase ( qw(configure build test runtime develop other) ) {
next unless $req_hash->{$phase};
next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING});
for my $type ( qw(requires recommends suggests conflicts modules) ) {
next unless $req_hash->{$phase}{$type};
my $title = ucfirst($phase).' '.ucfirst($type);
my @reports = [qw/Module Want Have/];
for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) {
next if grep { $_ eq $mod } @exclude;
my $want = $req_hash->{$phase}{$type}{$mod};
$want = "undef" unless defined $want;
$want = "any" if !$want && $want == 0;
if ($mod eq 'perl') {
push @reports, ['perl', $want, $]];
next;
}
my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";
my $file = $mod;
$file =~ s{::}{/}g;
$file .= ".pm";
my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;
if ($prefix) {
my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
$have = "undef" unless defined $have;
push @reports, [$mod, $want, $have];
if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
if ( $have !~ /\A$lax_version_re\z/ ) {
push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";
}
elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) {
push @dep_errors, "$mod version '$have' is not in required range '$want'";
}
}
}
else {
push @reports, [$mod, $want, "missing"];
if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
push @dep_errors, "$mod is not installed ($req_string)";
}
}
}
if ( @reports ) {
push @full_reports, "=== $title ===\n\n";
my $ml = _max( map { length $_->[0] } @reports );
my $wl = _max( map { length $_->[1] } @reports );
my $hl = _max( map { length $_->[2] } @reports );
if ($type eq 'modules') {
splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
}
else {
splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
}
push @full_reports, "\n";
}
}
}
if ( @full_reports ) {
diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
}
if ( $cpan_meta_error || @dep_errors ) {
diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n";
}
if ( $cpan_meta_error ) {
my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n";
}
if ( @dep_errors ) {
diag join("\n",
"\nThe following REQUIRED prerequisites were not satisfied:\n",
@dep_errors,
"\n"
);
}
pass('Reported prereqs');
# vim: ts=4 sts=4 sw=4 et:
author 000755 000765 000024 0 15145670555 17257 5 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/xt pod-syntax.t 100644 000765 000024 251 15145670555 21670 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/xt/author #!perl
# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests
use strict; use warnings;
use Test::More;
use Test::Pod 1.41;
all_pod_files_ok();
00-report-prereqs.dd 100644 000765 000024 4374 15145670555 21455 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/t do { my $x = {
'configure' => {
'requires' => {
'ExtUtils::MakeMaker' => '6.78'
}
},
'develop' => {
'requires' => {
'Encode' => '0',
'File::Spec' => '0',
'IO::Handle' => '0',
'IPC::Open3' => '0',
'Test::More' => '0.94',
'Test::Pod' => '1.41'
}
},
'runtime' => {
'requires' => {
'Carp' => '0',
'File::Basename' => '0',
'Getopt::Long' => '2.55',
'List::Util' => '0',
'Params::Validate' => '0.97',
'Scalar::Util' => '0',
'Sub::Exporter' => '0.972',
'Sub::Exporter::Util' => '0',
'overload' => '0',
'perl' => '5.012',
'strict' => '0',
'warnings' => '0'
}
},
'test' => {
'recommends' => {
'CPAN::Meta' => '2.120900'
},
'requires' => {
'CPAN::Meta::Check' => '0.011',
'CPAN::Meta::Requirements' => '0',
'ExtUtils::MakeMaker' => '0',
'File::Spec' => '0',
'Term::ANSIColor' => '0',
'Test::Fatal' => '0',
'Test::More' => '0.96',
'Test::Warnings' => '0.005'
}
}
};
$x;
} 00-compile.t 100644 000765 000024 2654 15145670555 21460 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/xt/author use strict;
use warnings;
# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.059
use Test::More 0.94;
plan tests => 4;
my @module_files = (
'Getopt/Long/Descriptive.pm',
'Getopt/Long/Descriptive/Opts.pm',
'Getopt/Long/Descriptive/Usage.pm'
);
# no fake home requested
my @switches = (
-d 'blib' ? '-Mblib' : '-Ilib',
);
use File::Spec;
use IPC::Open3;
use IO::Handle;
open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
my @warnings;
for my $lib (@module_files)
{
# see L
my $stderr = IO::Handle->new;
diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'}.$str.q{'} }
$^X, @switches, '-e', "require q[$lib]"))
if $ENV{PERL_COMPILE_TEST_DEBUG};
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
and not eval { +require blib; blib->VERSION('1.01') };
if (@_warnings)
{
warn @_warnings;
push @warnings, @_warnings;
}
}
is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', explain(\@warnings);
BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing;
Long 000755 000765 000024 0 15145670555 20231 5 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/lib/Getopt Descriptive.pm 100644 000765 000024 116330 15145670555 23254 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/lib/Getopt/Long use strict;
use warnings;
package Getopt::Long::Descriptive 0.117;
# ABSTRACT: Getopt::Long, but simpler and more powerful
use v5.12;
use Carp qw(carp croak);
use File::Basename ();
use Getopt::Long 2.55;
use List::Util qw(first);
use Params::Validate 0.97 qw(:all);
use Scalar::Util ();
use Getopt::Long::Descriptive::Opts;
use Getopt::Long::Descriptive::Usage;
#pod =head1 SYNOPSIS
#pod
#pod use Getopt::Long::Descriptive;
#pod
#pod my ($opt, $usage) = describe_options(
#pod 'my-program %o ',
#pod [ 'server|s=s', "the server to connect to", { required => 1 } ],
#pod [ 'port|p=i', "the port to connect to", { default => 79 } ],
#pod [],
#pod [ 'verbose|v', "print extra stuff" ],
#pod [ 'help', "print usage message and exit", { shortcircuit => 1 } ],
#pod );
#pod
#pod print($usage->text), exit if $opt->help;
#pod
#pod Client->connect( $opt->server, $opt->port );
#pod
#pod print "Connected!\n" if $opt->verbose;
#pod
#pod ...and running C will produce:
#pod
#pod my-program [-psv] [long options...]
#pod -s --server the server to connect to
#pod -p --port the port to connect to
#pod
#pod -v --verbose print extra stuff
#pod --help print usage message and exit
#pod
#pod =head1 DESCRIPTION
#pod
#pod Getopt::Long::Descriptive is yet another Getopt library. It's built atop
#pod Getopt::Long, and gets a lot of its features, but tries to avoid making you
#pod think about its huge array of options.
#pod
#pod It also provides usage (help) messages, data validation, and a few other useful
#pod features.
#pod
#pod =head1 FUNCTIONS
#pod
#pod Getopt::Long::Descriptive only exports one routine by default:
#pod C. All GLD's exports are exported by L.
#pod
#pod =head2 describe_options
#pod
#pod my ($opt, $usage) = describe_options($usage_desc, @opt_spec, \%arg);
#pod
#pod This routine inspects C<@ARGV> for options that match the supplied spec. If all
#pod the options are valid then it returns the options given and an object for
#pod generating usage messages; if not then it dies with an explanation of what was
#pod wrong and a usage message.
#pod
#pod The C<$opt> object will be a dynamically-generated subclass of
#pod L. In brief, each of the options in
#pod C<@opt_spec> becomes an accessor method on the object, using the first-given
#pod name, with dashes converted to underscores. For more information, see the
#pod documentation for the Opts class.
#pod
#pod The C<$usage> object will be a L object,
#pod which provides a C method to get the text of the usage message and C
#pod to die with it. For more methods and options, consults the documentation for
#pod the Usage class.
#pod
#pod =head3 $usage_desc
#pod
#pod The C<$usage_desc> parameter to C is a C-like string
#pod that is used in generating the first line of the usage message. It's a
#pod one-line summary of how the command is to be invoked. A typical usage
#pod description might be:
#pod
#pod $usage_desc = "%c %o ";
#pod
#pod C<%c> will be replaced with what Getopt::Long::Descriptive thinks is the
#pod program name (it's computed from C<$0>, see L).
#pod
#pod C<%o> will be replaced with a list of the short options, as well as the text
#pod "[long options...]" if any have been defined.
#pod
#pod The rest of the usage description can be used to summarize what arguments are
#pod expected to follow the program's options, and is entirely free-form.
#pod
#pod Literal C<%> characters will need to be written as C<%%>, just like with
#pod C.
#pod
#pod =head3 @opt_spec
#pod
#pod The C<@opt_spec> part of the args to C is used to configure
#pod option parsing and to produce the usage message. Each entry in the list is an
#pod arrayref describing one option, like this:
#pod
#pod @opt_spec = (
#pod [ "verbose|V" => "be noisy" ],
#pod [ "logfile=s" => "file to log to" ],
#pod );
#pod
#pod The first value in the arrayref is a Getopt::Long-style option specification.
#pod In brief, they work like this: each one is a pipe-delimited list of names,
#pod optionally followed by a type declaration. Type declarations are '=x' or ':x',
#pod where C<=> means a value is required and C<:> means it is optional. I may
#pod be 's' to indicate a string is required, 'i' for an integer, or 'f' for a
#pod number with a fractional part. The type spec may end in C<@> to indicate that
#pod the option may appear multiple times.
#pod
#pod For more information on how these work, see the L documentation.
#pod
#pod The first name given should be the canonical name, as it will be used as the
#pod accessor method on the C<$opt> object. Dashes in the name will be converted to
#pod underscores, and all letters will be lowercased. For this reason, all options
#pod should generally have a long-form name.
#pod
#pod The second value in the arrayref is a description of the option, for use in the
#pod usage message.
#pod
#pod =head4 Special Option Specifications
#pod
#pod If the option specification (arrayref) is empty, it will have no effect other
#pod than causing a blank line to appear in the usage message.
#pod
#pod If the option specification contains only one element, it will be printed in
#pod the usage message with no other effect. If the element is a reference, its
#pod referent will be printed as-is. Otherwise, it will be reformatted like other
#pod text in the usage message.
#pod
#pod If the option specification contains a third element, it adds extra constraints
#pod or modifiers to the interpretation and validation of the value. These are the
#pod keys that may be present in that hashref, and how they behave:
#pod
#pod =over 4
#pod
#pod =item implies
#pod
#pod implies => 'bar'
#pod implies => [qw(foo bar)]
#pod implies => { foo => 1, bar => 2 }
#pod
#pod If option I has an "implies" entry, then if I is given, other options
#pod will be enabled. The value may be a single option to set, an arrayref of
#pod options to set, or a hashref of options to set to specific values.
#pod
#pod =item required
#pod
#pod required => 1
#pod
#pod If an option is required, failure to provide the option will result in
#pod C printing the usage message and exiting.
#pod
#pod =item hidden
#pod
#pod hidden => 1
#pod
#pod This option will not show up in the usage text.
#pod
#pod You can achieve the same behavior by using the string "hidden" for the option's
#pod description.
#pod
#pod =item one_of
#pod
#pod one_of => \@subopt_specs
#pod
#pod This is useful for a group of options that are related. Each option
#pod spec is added to the list for normal parsing and validation.
#pod
#pod Your option name will end up with a value of the name of the
#pod option that was chosen. For example, given the following spec:
#pod
#pod [ "mode" => hidden => { one_of => [
#pod [ "get|g" => "get the value" ],
#pod [ "set|s" => "set the value" ],
#pod [ "delete" => "delete it" ],
#pod ] } ],
#pod
#pod No usage text for 'mode' will be displayed, but text for get, set, and delete
#pod will be displayed.
#pod
#pod If more than one of get, set, or delete is given, an error will be thrown.
#pod
#pod So, given the C<@opt_spec> above, and an C<@ARGV> of C<('--get')>, the
#pod following would be true:
#pod
#pod $opt->get == 1;
#pod
#pod $opt->mode eq 'get';
#pod
#pod B: C would not be set if C defaulted to 'get' and no arguments
#pod were passed in.
#pod
#pod Even though the option sub-specs for C are meant to be 'first
#pod class' specs, some options don't make sense with them, e.g. C.
#pod
#pod As a further shorthand, you may specify C options using this form:
#pod
#pod [ mode => \@option_specs, \%constraints ]
#pod
#pod
#pod =item shortcircuit
#pod
#pod shortcircuit => 1
#pod
#pod If this option is present no other options will be returned. Other
#pod options present will be checked for proper types, but I for
#pod constraints. This provides a way of specifying C<--help> style options.
#pod
#pod =item Params::Validate
#pod
#pod In addition, any constraint understood by Params::Validate may be used.
#pod
#pod For example, to accept positive integers:
#pod
#pod [ 'max-iterations=i', "maximum number of iterations",
#pod { callbacks => { positive => sub { shift() > 0 } } } ],
#pod
#pod (Internally, all constraints are translated into Params::Validate options or
#pod callbacks.)
#pod
#pod =back
#pod
#pod =head3 %arg
#pod
#pod The C<%arg> to C is optional. If the last parameter is a
#pod hashref, it contains extra arguments to modify the way C
#pod works. Valid arguments are:
#pod
#pod getopt_conf - an arrayref of strings, passed to Getopt::Long::Configure
#pod show_defaults - a boolean which controls whether an option's default
#pod value (if applicable) is shown as part of the usage message
#pod (for backward compatibility this defaults to false)
#pod
#pod =head2 prog_name
#pod
#pod This routine, exported on demand, returns the basename of C<$0>, grabbed at
#pod compile-time. You can override this guess by calling C
#pod yourself.
#pod
#pod =head1 OTHER EXPORTS
#pod
#pod =head2 C<-types>
#pod
#pod Any of the Params::Validate type constants (C, etc.) can be imported as
#pod well. You can get all of them at once by importing C<-types>.
#pod
#pod =head2 C<-all>
#pod
#pod This import group will import C<-type>, C, and C.
#pod
#pod =cut
my $prog_name;
sub prog_name { @_ ? ($prog_name = shift) : $prog_name }
BEGIN {
# grab this before someone decides to change it
prog_name(File::Basename::basename($0));
}
use Sub::Exporter::Util ();
use Sub::Exporter 0.972 -setup => {
exports => [
describe_options => \'_build_describe_options',
q(prog_name),
@{ $Params::Validate::EXPORT_TAGS{types} }
],
groups => [
default => [ qw(describe_options) ],
types => $Params::Validate::EXPORT_TAGS{types},
],
};
my %CONSTRAINT = (
implies => \&_mk_implies,
only_one => \&_mk_only_one,
);
our $MungeOptions = 1;
our $TERM_WIDTH;
{
$TERM_WIDTH = $ENV{COLUMNS} || 80;
# So, this was the old code:
#
# if (eval { require Term::ReadKey; 1 }) {
# my ($width) = Term::ReadKey::GetTerminalSize();
# $TERM_WIDTH = $width;
# } else {
# $TERM_WIDTH = $ENV{COLUMNS} || 80;
# }
#
# ...but the problem is that Term::ReadKey will carp when it can't get an
# answer, it can't be trivially made to keep quiet. (I decline to stick a
# local $SIG{__WARN__} here, as it's too heavy a hammer.) With the new (as
# of 2021-03) formatting code, using the full width is less of an issue,
# anyway.
}
sub _nohidden {
return grep { ! $_->{constraint}->{hidden} } @_;
}
sub _expand {
my @expanded;
for my $opt (@_) {
push @expanded, {
spec => $opt->[0] || '',
desc => @$opt > 1 ? $opt->[1] : 'spacer',
constraint => $opt->[2] || {},
# if @$_ is 0 then we got [], a spacer
name => @$opt ? _munge((split /[:=|!+]/, $opt->[0] || '')[0]) : '',
};
}
return @expanded;
}
my %HIDDEN = (
hidden => 1,
);
my $SPEC_RE = qr{(?:[:=][0-9\w\+]+[%@]?(\{[0-9]*,[0-9]*\})?|[!+])$};
sub _strip_assignment {
my ($self, $str) = @_;
(my $copy = $str) =~ s{$SPEC_RE}{};
if (wantarray) {
my $len = length $copy;
my $assignment = substr($str, $len) // q{};
return ($copy, $assignment);
}
return $copy;
}
# This is here only to deal with people who were calling this fully-qualified
# without importing. Sucks to them! -- rjbs, 2009-08-21
sub describe_options {
my $sub = __PACKAGE__->_build_describe_options(describe_options => {} => {});
$sub->(@_);
}
sub usage_class { 'Getopt::Long::Descriptive::Usage' }
sub _build_describe_options {
my ($class) = @_;
sub {
my $format = (ref $_[0] ? '%c %o' : shift(@_));
my $arg = (ref $_[-1] and ref $_[-1] eq 'HASH') ? pop @_ : {};
# If GETOPT_LONG_DESCRIPTIVE_COMPLETION is set, emit a shell completion
# script to stdout and exit 42. Supported values are 'bash' and 'zsh'.
# Any other value raises an exception. If
# GETOPT_LONG_DESCRIPTIVE_COMPLETION_NAME is set, it is treated as a
# comma-separated list of command names to register completion for,
# overriding the script name. -- claude, 2026-02-19
if (my $shell = $ENV{GETOPT_LONG_DESCRIPTIVE_COMPLETION}) {
if ($shell eq 'bash') {
print _bash_completion_script(@_);
exit 42;
} elsif ($shell eq 'zsh') {
print _zsh_completion_script(@_);
exit 42;
} else {
Carp::croak("unknown shell '$shell' in GETOPT_LONG_DESCRIPTIVE_COMPLETION");
}
}
my @opts;
my %parent_of;
# special casing
# wish we had real loop objects
my %method_map;
for my $opt (_expand(@_)) {
$method_map{ $opt->{name} } = undef unless $opt->{desc} eq 'spacer';
if (ref($opt->{desc}) eq 'ARRAY') {
$opt->{constraint}->{one_of} = delete $opt->{desc};
$opt->{desc} = 'hidden';
}
if ($HIDDEN{$opt->{desc}}) {
$opt->{constraint}->{hidden}++;
}
if ($opt->{constraint}->{one_of}) {
for my $one_opt (_expand(
@{delete $opt->{constraint}->{one_of}}
)) {
$parent_of{$one_opt->{name}} = $opt->{name};
$one_opt->{constraint}->{implies}
->{$opt->{name}} = $one_opt->{name};
for my $wipe (qw(required default)) {
if ($one_opt->{constraint}->{$wipe}) {
carp "'$wipe' constraint does not make sense in sub-option";
delete $one_opt->{constraint}->{$wipe};
}
}
$one_opt->{constraint}->{one_of} = $opt->{name};
push @opts, $one_opt;
# Ensure that we generate accessors for all one_of sub-options
$method_map{ $one_opt->{name} } = undef
unless $one_opt->{desc} eq 'spacer';
}
}
if ($opt->{constraint}{shortcircuit}
&& exists $opt->{constraint}{default}
) {
carp('option "' . $opt->{name} . q[": 'default' does not make sense for shortcircuit options]);
}
push @opts, $opt;
}
my @go_conf = @{ $arg->{getopt_conf} || $arg->{getopt} || [] };
if ($arg->{getopt}) {
warn "describe_options: 'getopt' is deprecated, please use 'getopt_conf' instead\n";
}
push @go_conf, "bundling" unless grep { /bundling/i } @go_conf;
push @go_conf, "no_auto_help" unless grep { /no_auto_help/i } @go_conf;
push @go_conf, "no_ignore_case"
unless grep { /no_ignore_case/i } @go_conf;
# not entirely sure that all of this (until the Usage->new) shouldn't be
# moved into Usage -- rjbs, 2009-08-19
# all specs including hidden
my @getopt_specs =
map { $_->{spec} }
grep { $_->{desc} ne 'spacer' }
@opts;
my @specs =
map { $_->{spec} }
grep { $_->{desc} ne 'spacer' }
_nohidden(@opts);
my @options =
map { split /\|/ }
map { scalar __PACKAGE__->_strip_assignment($_) }
@specs;
my %opt_count;
$opt_count{$_}++ for @options;
my $short = join q{},
sort { lc $a cmp lc $b or $a cmp $b }
grep { /^.$/ }
@options;
my $long = grep /\b[^|]{2,}/, @specs;
my %replace = (
"%" => "%",
"c" => prog_name,
"o" => join(q{ },
($short ? "[-$short]" : ()),
($long ? "[long options...]" : ())
),
);
(my $str = $format) =~ s<%(.)><
$replace{$1}
// Carp::croak("unknown sequence %$1 in first argument to describe_options")
>ge;
$str =~ s/[\x20\t]{2,}/ /g;
my $usage = $class->usage_class->new({
options => [ _nohidden(@opts) ],
leader_text => $str,
show_defaults => $arg->{show_defaults},
});
my $old_go_conf = Getopt::Long::Configure(@go_conf);
my %return;
$usage->die unless GetOptions(\%return, grep { length } @getopt_specs);
my @given_keys = keys %return;
Getopt::Long::Configure($old_go_conf);
for my $opt (keys %return) {
my $newopt = _munge($opt);
next if $newopt eq $opt;
$return{$newopt} = delete $return{$opt};
}
# ensure that shortcircuit options are handled first
for my $copt (
sort { ($b->{constraint}{shortcircuit} || 0)
<=> ($a->{constraint}{shortcircuit} || 0)
} grep { $_->{constraint} } @opts
) {
delete $copt->{constraint}->{hidden};
my $is_shortcircuit = delete $copt->{constraint}{shortcircuit};
my $name = $copt->{name};
my $new = _validate_with(
name => $name,
params => \%return,
spec => $copt->{constraint},
opts => \@opts,
usage => $usage,
given_keys => \@given_keys,
parent_of => \%parent_of,
);
next unless defined $new || exists $return{$name};
$return{$name} = $new;
if ($is_shortcircuit) {
%return = ($name => $return{$name});
last;
}
}
my $opt_obj = Getopt::Long::Descriptive::Opts->___new_opt_obj({
values => { %method_map, %return },
given => { map {; $_ => 1 } @given_keys },
});
return($opt_obj, $usage);
}
}
sub _munge {
my ($opt) = @_;
return $opt unless $MungeOptions;
$opt = lc($opt);
$opt =~ tr/-/_/;
return $opt;
}
sub _validate_with {
my (%arg) = validate(@_, {
name => 1,
params => 1,
spec => 1,
opts => 1,
usage => 1,
given_keys => 1,
parent_of => 1,
});
my $spec = $arg{spec};
my %pvspec;
SPEC_ENTRY: for my $ct (keys %{$spec}) {
if ($ct eq 'required') {
# This used to be in %CONSTRAINT but this whole system is a bit
# overcomplex, I think, and moving this here makes life simpler. Someday
# (ha ha) this can all be overhauled. -- rjbs, 2024-01-20
$pvspec{optional} = ! $spec->{$ct};
next SPEC_ENTRY;
}
if ($CONSTRAINT{$ct} and ref $CONSTRAINT{$ct} eq 'CODE') {
$pvspec{callbacks} ||= {};
$pvspec{callbacks} = {
%{$pvspec{callbacks}},
$CONSTRAINT{$ct}->(
$arg{name},
$spec->{$ct},
$arg{params},
$arg{opts},
),
};
} else {
%pvspec = (
%pvspec,
$CONSTRAINT{$ct} ? %{$CONSTRAINT{$ct}} : ($ct => $spec->{$ct}),
);
}
}
$pvspec{optional} = 1 unless exists $pvspec{optional};
# we need to implement 'default' by ourselves sometimes
# because otherwise the implies won't be checked/executed
# XXX this should be more generic -- we'll probably want
# other callbacks to always run, too
if (!defined($arg{params}{$arg{name}})
&& $pvspec{default}
&& $spec->{implies}) {
$arg{params}{$arg{name}} = delete $pvspec{default};
}
my %p;
my $ok = eval {
%p = validate_with(
params => [
%{$arg{params}},
'-given_keys', $arg{given_keys},
'-parent_of', $arg{parent_of},
],
spec => { $arg{name} => \%pvspec },
allow_extra => 1,
on_fail => sub {
my $fail_msg = shift;
Getopt::Long::Descriptive::_PV_Error->throw($fail_msg);
},
);
1;
};
if (! $ok) {
my $error = $@;
if (
Scalar::Util::blessed($error)
&& $error->isa('Getopt::Long::Descriptive::_PV_Error')
) {
$arg{usage}->die({ pre_text => $error->error . "\n" });
}
die $@;
}
return $p{$arg{name}};
}
# scalar: single option = true
# arrayref: multiple options = true
# hashref: single/multiple options = given values
sub _norm_imply {
my ($what) = @_;
return { $what => 1 } unless my $ref = ref $what;
return $what if $ref eq 'HASH';
return { map { $_ => 1 } @$what } if $ref eq 'ARRAY';
die "can't imply: $what";
}
sub _mk_implies {
my $name = shift;
my $what = _norm_imply(shift);
my $param = shift;
my $opts = shift;
for my $implied (keys %$what) {
die("option specification for $name implies nonexistent option $implied\n")
unless first { $_->{name} eq $implied } @$opts
}
my $whatstr = join(q{, }, map { "$_=$what->{$_}" } keys %$what);
return "$name implies $whatstr" => sub {
my ($pv_val, $rest) = @_;
# negatable options will be 0 here, which is ok.
return 1 unless defined $pv_val;
while (my ($key, $val) = each %$what) {
# Really, this should be called "-implies" and should include all implies
# relationships, but they'll have to get handled by setting conflicts.
my $parent = $rest->{'-parent_of'}{$name};
my @siblings = $parent
? (grep {; defined $rest->{'-parent_of'}{$_}
&& $rest->{'-parent_of'}{$_} eq $parent }
@{ $rest->{'-given_keys'} })
: ();
if (@siblings > 1) {
die "these options conflict; each wants to set the $parent: @siblings\n";
}
if ( exists $param->{$key}
and $param->{$key} ne $val
and grep {; $_ eq $key } @{ $rest->{'-given_keys'} }
) {
die(
"option specification for $name implies that $key should be "
. "set to '$val', but it is '$param->{$key}' already\n"
);
}
$param->{$key} = $val;
}
return 1;
};
}
sub _mk_only_one {
die "unimplemented";
}
# Parse the opt_spec list (same format as describe_options) into a list of
# hashrefs suitable for generating completion data. Hidden and spacer entries
# are omitted. one_of grouping options are transparent: the outer option is
# skipped and its sub-options are included in its place.
sub _parse_specs_for_completion {
pop if ref $_[-1] eq 'HASH';
my @parsed;
for my $opt (_expand(@_)) {
next if $opt->{desc} eq 'spacer'; # skip spacers and display-only text entries
my $constraint = $opt->{constraint};
# one_of comes in two forms:
# Form 1: [ 'group', [ [inner specs...] ] ] -- desc is the arrayref
# Form 2: [ 'group', 'desc', { one_of => [...] } ] -- explicit constraint
# In both cases suppress the outer option and recurse into the sub-options.
if (ref($opt->{desc}) eq 'ARRAY') {
push @parsed, _parse_specs_for_completion(@{ $opt->{desc} });
next;
}
if (ref($constraint->{one_of}) eq 'ARRAY') {
push @parsed, _parse_specs_for_completion(@{ $constraint->{one_of} });
next;
}
next if $constraint->{hidden} || ($opt->{desc} // '') eq 'hidden';
my ($names_str, $assignment) = __PACKAGE__->_strip_assignment($opt->{spec});
push @parsed, {
names => [ split /\|/, $names_str ],
takes_value => !!($assignment =~ /\A[:=]/),
negatable => !!($assignment =~ /\A!/),
desc => $opt->{desc},
completion => $constraint->{completion},
};
}
return @parsed;
}
sub _bash_completion_action {
my ($completion) = @_;
if (ref $completion eq 'ARRAY') {
return undef unless @$completion;
my $vals = join q{ }, @$completion;
return qq{COMPREPLY=(\$(compgen -W "$vals" -- "\$cur"))};
}
return q{COMPREPLY=($(compgen -f -- "$cur"))} if $completion eq 'files';
return q{COMPREPLY=($(compgen -d -- "$cur"))} if $completion eq 'dirs';
if ($completion =~ /\Afn:(.+)\z/) {
return qq{COMPREPLY=(\$($1 "\$cur"))};
}
return undef;
}
sub _zsh_completion_action {
my ($completion) = @_;
return '_files' if $completion eq 'files';
return '_files -/' if $completion eq 'dirs';
if (ref $completion eq 'ARRAY') {
return '(' . join(' ', @$completion) . ')';
}
if ($completion =~ /\Afn:(.+)\z/) {
return $1;
}
return '';
}
# _completion_for_bash(\@opt_spec)
#
# Given an @opt_spec in the same format as describe_options, returns a hashref
# describing bash completion for those options.
#
# The 'flags' key holds a space-separated string of all option flags, suitable
# for passing to compgen -W.
#
# The 'prev_cases' key holds an arrayref of hashrefs, each with a 'pattern'
# (suitable for a case "$prev" arm) and an 'action' (bash code that sets
# COMPREPLY). Only options that carry a 'completion' key in their constraint
# hashref produce a prev_case entry.
#
# The 'completion' key in an option's constraint hashref may be:
# - an arrayref: completes from a fixed list
# - 'files': completes to file paths
# - 'dirs': completes to directory paths
# - 'fn:NAME': delegates to the named shell function; $cur is available
# in the environment
sub _completion_for_bash {
my (@specs) = @_;
my @flags;
my @prev_cases;
for my $p (_parse_specs_for_completion(@specs)) {
for my $name (@{ $p->{names} }) {
push @flags, length($name) == 1 ? "-$name" : "--$name";
push @flags, "--no-$name" if $p->{negatable} && length($name) > 1;
}
if ($p->{takes_value} && defined $p->{completion}) {
my $action = _bash_completion_action($p->{completion});
if (defined $action) {
my $pattern = join '|',
map { length($_) == 1 ? "-$_" : "--$_" } @{ $p->{names} };
push @prev_cases, { pattern => $pattern, action => $action };
}
}
}
return {
flags => join(' ', @flags),
prev_cases => \@prev_cases,
};
}
# _completion_for_zsh(@opt_spec)
#
# Given an @opt_spec in the same format as describe_options, returns a list of
# strings in _arguments spec format for use in a zsh completion function.
# Each string describes one option flag. The 'completion' constraint key is
# supported with the same values as _completion_for_bash.
sub _completion_for_zsh {
my (@specs) = @_;
my @args;
for my $p (_parse_specs_for_completion(@specs)) {
my $safe_desc = $p->{desc} // '';
$safe_desc =~ s/\[/\\[/g;
$safe_desc =~ s/\]/\\]/g;
$safe_desc =~ s/'/'\\''/g;
for my $name (@{ $p->{names} }) {
my $flag = length($name) == 1 ? "-$name" : "--$name";
if ($p->{takes_value}) {
my $action = defined $p->{completion}
? _zsh_completion_action($p->{completion})
: '';
push @args, qq('${flag}=[${safe_desc}]: :${action}');
} else {
push @args, qq('${flag}[${safe_desc}]');
}
push @args, qq('--no-${name}[disable ${name}]')
if $p->{negatable} && length($name) > 1;
}
}
return @args;
}
sub _completion_names {
if (my $names = $ENV{GETOPT_LONG_DESCRIPTIVE_COMPLETION_NAME}) {
return split /,/, $names;
}
return prog_name();
}
sub _bash_completion_script {
my @names = _completion_names();
(my $fn_name = "_$names[0]_completion") =~ s/[^a-zA-Z0-9_]/_/g;
my $data = _completion_for_bash(@_);
my $script = "$fn_name() {\n";
$script .= " local cur prev\n";
$script .= " COMPREPLY=()\n";
$script .= ' cur="${COMP_WORDS[COMP_CWORD]}"' . "\n";
$script .= ' prev="${COMP_WORDS[COMP_CWORD-1]}"' . "\n";
if (@{ $data->{prev_cases} }) {
$script .= " case \"\$prev\" in\n";
for my $case (@{ $data->{prev_cases} }) {
$script .= " $case->{pattern})\n";
$script .= " $case->{action}\n";
$script .= " return\n";
$script .= " ;;\n";
}
$script .= " esac\n";
}
my $flags = $data->{flags};
$script .= " COMPREPLY=(\$(compgen -W \"$flags\" -- \"\$cur\"))\n";
$script .= "}\n";
$script .= "complete -F $fn_name $_\n" for @names;
return $script;
}
sub _zsh_completion_script {
my @names = _completion_names();
(my $fn_name = "_$names[0]") =~ s/[^a-zA-Z0-9_]/_/g;
my @args = _completion_for_zsh(@_);
my $script = "#compdef " . join(' ', @names) . "\n";
$script .= "$fn_name() {\n";
$script .= " local -a arguments\n";
$script .= " arguments=(\n";
$script .= " $_\n" for @args;
$script .= " )\n";
$script .= " _arguments \$arguments\n";
$script .= "}\n";
$script .= "$fn_name\n";
return $script;
}
{
package
Getopt::Long::Descriptive::_PV_Error;
sub error { $_[0]->{error} }
sub throw {
my ($class, $error_msg) = @_;
my $self = { error => $error_msg };
bless $self, $class;
die $self;
}
}
#pod =head1 CUSTOMIZING
#pod
#pod Getopt::Long::Descriptive uses L to build and
#pod export the C routine. By writing a new class that extends
#pod Getopt::Long::Descriptive, the behavior of the constructed C
#pod routine can be changed.
#pod
#pod The following methods can be overridden:
#pod
#pod =head2 usage_class
#pod
#pod my $class = Getopt::Long::Descriptive->usage_class;
#pod
#pod This returns the class to be used for constructing a Usage object, and defaults
#pod to Getopt::Long::Descriptive::Usage.
#pod
#pod =head1 SEE ALSO
#pod
#pod =for :list
#pod * L
#pod * L
#pod
#pod =cut
1; # End of Getopt::Long::Descriptive
__END__
=pod
=encoding UTF-8
=head1 NAME
Getopt::Long::Descriptive - Getopt::Long, but simpler and more powerful
=head1 VERSION
version 0.117
=head1 SYNOPSIS
use Getopt::Long::Descriptive;
my ($opt, $usage) = describe_options(
'my-program %o ',
[ 'server|s=s', "the server to connect to", { required => 1 } ],
[ 'port|p=i', "the port to connect to", { default => 79 } ],
[],
[ 'verbose|v', "print extra stuff" ],
[ 'help', "print usage message and exit", { shortcircuit => 1 } ],
);
print($usage->text), exit if $opt->help;
Client->connect( $opt->server, $opt->port );
print "Connected!\n" if $opt->verbose;
...and running C will produce:
my-program [-psv] [long options...]
-s --server the server to connect to
-p --port the port to connect to
-v --verbose print extra stuff
--help print usage message and exit
=head1 DESCRIPTION
Getopt::Long::Descriptive is yet another Getopt library. It's built atop
Getopt::Long, and gets a lot of its features, but tries to avoid making you
think about its huge array of options.
It also provides usage (help) messages, data validation, and a few other useful
features.
=head1 PERL VERSION
This library should run on perls released even a long time ago. It should
work on any version of perl released in the last five years.
Although it may work on older versions of perl, no guarantee is made that the
minimum required version will not be increased. The version may be increased
for any reason, and there is no promise that patches will be accepted to
lower the minimum required perl.
=head1 FUNCTIONS
Getopt::Long::Descriptive only exports one routine by default:
C. All GLD's exports are exported by L.
=head2 describe_options
my ($opt, $usage) = describe_options($usage_desc, @opt_spec, \%arg);
This routine inspects C<@ARGV> for options that match the supplied spec. If all
the options are valid then it returns the options given and an object for
generating usage messages; if not then it dies with an explanation of what was
wrong and a usage message.
The C<$opt> object will be a dynamically-generated subclass of
L. In brief, each of the options in
C<@opt_spec> becomes an accessor method on the object, using the first-given
name, with dashes converted to underscores. For more information, see the
documentation for the Opts class.
The C<$usage> object will be a L object,
which provides a C method to get the text of the usage message and C
to die with it. For more methods and options, consults the documentation for
the Usage class.
=head3 $usage_desc
The C<$usage_desc> parameter to C is a C-like string
that is used in generating the first line of the usage message. It's a
one-line summary of how the command is to be invoked. A typical usage
description might be:
$usage_desc = "%c %o ";
C<%c> will be replaced with what Getopt::Long::Descriptive thinks is the
program name (it's computed from C<$0>, see L).
C<%o> will be replaced with a list of the short options, as well as the text
"[long options...]" if any have been defined.
The rest of the usage description can be used to summarize what arguments are
expected to follow the program's options, and is entirely free-form.
Literal C<%> characters will need to be written as C<%%>, just like with
C.
=head3 @opt_spec
The C<@opt_spec> part of the args to C is used to configure
option parsing and to produce the usage message. Each entry in the list is an
arrayref describing one option, like this:
@opt_spec = (
[ "verbose|V" => "be noisy" ],
[ "logfile=s" => "file to log to" ],
);
The first value in the arrayref is a Getopt::Long-style option specification.
In brief, they work like this: each one is a pipe-delimited list of names,
optionally followed by a type declaration. Type declarations are '=x' or ':x',
where C<=> means a value is required and C<:> means it is optional. I may
be 's' to indicate a string is required, 'i' for an integer, or 'f' for a
number with a fractional part. The type spec may end in C<@> to indicate that
the option may appear multiple times.
For more information on how these work, see the L documentation.
The first name given should be the canonical name, as it will be used as the
accessor method on the C<$opt> object. Dashes in the name will be converted to
underscores, and all letters will be lowercased. For this reason, all options
should generally have a long-form name.
The second value in the arrayref is a description of the option, for use in the
usage message.
=head4 Special Option Specifications
If the option specification (arrayref) is empty, it will have no effect other
than causing a blank line to appear in the usage message.
If the option specification contains only one element, it will be printed in
the usage message with no other effect. If the element is a reference, its
referent will be printed as-is. Otherwise, it will be reformatted like other
text in the usage message.
If the option specification contains a third element, it adds extra constraints
or modifiers to the interpretation and validation of the value. These are the
keys that may be present in that hashref, and how they behave:
=over 4
=item implies
implies => 'bar'
implies => [qw(foo bar)]
implies => { foo => 1, bar => 2 }
If option I has an "implies" entry, then if I is given, other options
will be enabled. The value may be a single option to set, an arrayref of
options to set, or a hashref of options to set to specific values.
=item required
required => 1
If an option is required, failure to provide the option will result in
C printing the usage message and exiting.
=item hidden
hidden => 1
This option will not show up in the usage text.
You can achieve the same behavior by using the string "hidden" for the option's
description.
=item one_of
one_of => \@subopt_specs
This is useful for a group of options that are related. Each option
spec is added to the list for normal parsing and validation.
Your option name will end up with a value of the name of the
option that was chosen. For example, given the following spec:
[ "mode" => hidden => { one_of => [
[ "get|g" => "get the value" ],
[ "set|s" => "set the value" ],
[ "delete" => "delete it" ],
] } ],
No usage text for 'mode' will be displayed, but text for get, set, and delete
will be displayed.
If more than one of get, set, or delete is given, an error will be thrown.
So, given the C<@opt_spec> above, and an C<@ARGV> of C<('--get')>, the
following would be true:
$opt->get == 1;
$opt->mode eq 'get';
B: C would not be set if C defaulted to 'get' and no arguments
were passed in.
Even though the option sub-specs for C are meant to be 'first
class' specs, some options don't make sense with them, e.g. C.
As a further shorthand, you may specify C options using this form:
[ mode => \@option_specs, \%constraints ]
=item shortcircuit
shortcircuit => 1
If this option is present no other options will be returned. Other
options present will be checked for proper types, but I for
constraints. This provides a way of specifying C<--help> style options.
=item Params::Validate
In addition, any constraint understood by Params::Validate may be used.
For example, to accept positive integers:
[ 'max-iterations=i', "maximum number of iterations",
{ callbacks => { positive => sub { shift() > 0 } } } ],
(Internally, all constraints are translated into Params::Validate options or
callbacks.)
=back
=head3 %arg
The C<%arg> to C is optional. If the last parameter is a
hashref, it contains extra arguments to modify the way C
works. Valid arguments are:
getopt_conf - an arrayref of strings, passed to Getopt::Long::Configure
show_defaults - a boolean which controls whether an option's default
value (if applicable) is shown as part of the usage message
(for backward compatibility this defaults to false)
=head2 prog_name
This routine, exported on demand, returns the basename of C<$0>, grabbed at
compile-time. You can override this guess by calling C
yourself.
=head1 OTHER EXPORTS
=head2 C<-types>
Any of the Params::Validate type constants (C, etc.) can be imported as
well. You can get all of them at once by importing C<-types>.
=head2 C<-all>
This import group will import C<-type>, C, and C.
=head1 CUSTOMIZING
Getopt::Long::Descriptive uses L to build and
export the C routine. By writing a new class that extends
Getopt::Long::Descriptive, the behavior of the constructed C
routine can be changed.
The following methods can be overridden:
=head2 usage_class
my $class = Getopt::Long::Descriptive->usage_class;
This returns the class to be used for constructing a Usage object, and defaults
to Getopt::Long::Descriptive::Usage.
=head1 SEE ALSO
=over 4
=item *
L
=item *
L
=back
=head1 AUTHORS
=over 4
=item *
Hans Dieter Pearcey
=item *
Ricardo Signes
=back
=head1 CONTRIBUTORS
=for stopwords Arthur Axel 'fREW' Schmidt Dave Rolsky Diab Jerius Hans Dieter Pearcey Harley Pig hdp@cpan.org Karen Etheridge Michael McClimon Niels Thykier Olaf Alders Ricardo Signes Roman Hubacek Smylers Thomas Neumann zhouzhen1
=over 4
=item *
Arthur Axel 'fREW' Schmidt
=item *
Dave Rolsky
=item *
Diab Jerius
=item *
Hans Dieter Pearcey
=item *
Harley Pig
=item *
hdp@cpan.org
=item *
Karen Etheridge
=item *
Michael McClimon
=item *
Niels Thykier
=item *
Olaf Alders
=item *
Ricardo Signes
=item *
Roman Hubacek
=item *
Smylers
=item *
Thomas Neumann
=item *
zhouzhen1
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2005 by Hans Dieter Pearcey.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
release 000755 000765 000024 0 15145670555 17375 5 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/xt changes_has_content.t 100644 000765 000024 2101 15145670555 23711 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/xt/release use Test::More tests => 2;
note 'Checking Changes';
my $changes_file = 'Changes';
my $newver = '0.117';
my $trial_token = '-TRIAL';
my $encoding = 'UTF-8';
SKIP: {
ok(-e $changes_file, "$changes_file file exists")
or skip 'Changes is missing', 1;
ok(_get_changes($newver), "$changes_file has content for $newver");
}
done_testing;
sub _get_changes
{
my $newver = shift;
# parse changelog to find commit message
open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!";
my $changelog = join('', <$fh>);
if ($encoding) {
require Encode;
$changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK());
}
close $fh;
my @content =
grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented
split /\n/, $changelog;
shift @content; # drop the version line
# drop unindented last line and trailing blank lines
pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ );
# return number of non-blank lines
return scalar @content;
}
Descriptive 000755 000765 000024 0 15145670555 22512 5 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/lib/Getopt/Long Opts.pm 100644 000765 000024 14231 15145670555 24156 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/lib/Getopt/Long/Descriptive use strict;
use warnings;
package Getopt::Long::Descriptive::Opts 0.117;
# ABSTRACT: object representing command line switches
use Scalar::Util qw(blessed weaken);
#pod =head1 DESCRIPTION
#pod
#pod This class is the base class of all C<$opt> objects returned by
#pod L. In general, you do not want to think about this
#pod class, look at it, or alter it. Seriously, it's pretty dumb.
#pod
#pod Every call to C will return a object of a new subclass of
#pod this class. It will have a method for the canonical name of each option
#pod possible given the option specifications.
#pod
#pod Method names beginning with an single underscore are public, and are named that
#pod way to avoid conflict with automatically generated methods. Methods with
#pod multiple underscores (in case you're reading the source) are private.
#pod
#pod =head1 METHODS
#pod
#pod B All methods beginning with an underscore are experimental as of
#pod today, 2009-12-12. They are likely to be formally made permanent soon.
#pod
#pod =head2 _specified
#pod
#pod This method returns true if the given name was specified on the command line.
#pod
#pod For example, if C<@ARGS> was "C<< --foo --bar 10 >>" and C is defined by a
#pod default, C<_specified> will return true for foo and bar, and false for baz.
#pod
#pod =cut
my %_CREATED_OPTS;
my $SERIAL_NUMBER = 1;
sub _specified {
my ($self, $name) = @_;
my $meta = $_CREATED_OPTS{ blessed $self }{meta};
return $meta->{given}{ $name };
}
#pod =head2 _specified_opts
#pod
#pod This method returns an opt object in which only explicitly specified values are
#pod defined. Values which were set by defaults will appear undef.
#pod
#pod =cut
sub _specified_opts {
my ($self) = @_;
my $class = blessed $self;
my $meta = $_CREATED_OPTS{ $class }{meta};
return $meta->{specified_opts} if $meta->{specified_opts};
my @keys = grep { $meta->{given}{ $_ } } (keys %{ $meta->{given} });
my %opts;
@opts{ @keys } = @$self{ @keys };
$meta->{specified_opts} = \%opts;
bless $meta->{specified_opts} => $class;
weaken $meta->{specified_opts};
$meta->{specified_opts};
}
#pod =head2 _complete_opts
#pod
#pod This method returns the opts object with all values, including those set by
#pod defaults. It is probably not going to be very often-used.
#pod
#pod =cut
sub _complete_opts {
my ($self) = @_;
my $class = blessed $self;
my $meta = $_CREATED_OPTS{ $class }{meta};
return $meta->{complete_opts};
}
sub ___class_for_opt {
my ($class, $arg) = @_;
my $values = $arg->{values};
my @bad = grep { $_ !~ /^[a-z_]\w*$/ } keys %$values;
Carp::confess("perverse option names given: @bad") if @bad;
my $new_class = "$class\::__OPT__::" . $SERIAL_NUMBER++;
$_CREATED_OPTS{ $new_class } = { meta => $arg };
{
no strict 'refs';
${"$new_class\::VERSION"} = $class->VERSION;
*{"$new_class\::ISA"} = [ 'Getopt::Long::Descriptive::Opts' ];
for my $opt (keys %$values) {
*{"$new_class\::$opt"} = sub { $_[0]->{ $opt } };
}
}
return $new_class;
}
sub ___new_opt_obj {
my ($class, $arg) = @_;
my $copy = { %{ $arg->{values} } };
my $new_class = $class->___class_for_opt($arg);
# This is stupid, but the traditional behavior was that if --foo was not
# given, there is no $opt->{foo}; it started to show up when we "needed" all
# the keys to generate a class, but was undef; this wasn't a problem, but
# broke tests of things that were relying on not-exists like tests of %$opt
# contents or MooseX::Getopt which wanted to use things as args for new --
# undef would not pass an Int TC. Easier to just do this. -- rjbs,
# 2009-11-27
delete $copy->{$_} for grep { ! defined $copy->{$_} } keys %$copy;
my $self = bless $copy => $new_class;
$_CREATED_OPTS{ $new_class }{meta}{complete_opts} = $self;
# weaken $_CREATED_OPTS{ $new_class }{meta}{complete_opts};
return $self;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Getopt::Long::Descriptive::Opts - object representing command line switches
=head1 VERSION
version 0.117
=head1 DESCRIPTION
This class is the base class of all C<$opt> objects returned by
L. In general, you do not want to think about this
class, look at it, or alter it. Seriously, it's pretty dumb.
Every call to C will return a object of a new subclass of
this class. It will have a method for the canonical name of each option
possible given the option specifications.
Method names beginning with an single underscore are public, and are named that
way to avoid conflict with automatically generated methods. Methods with
multiple underscores (in case you're reading the source) are private.
=head1 PERL VERSION
This library should run on perls released even a long time ago. It should
work on any version of perl released in the last five years.
Although it may work on older versions of perl, no guarantee is made that the
minimum required version will not be increased. The version may be increased
for any reason, and there is no promise that patches will be accepted to
lower the minimum required perl.
=head1 METHODS
B All methods beginning with an underscore are experimental as of
today, 2009-12-12. They are likely to be formally made permanent soon.
=head2 _specified
This method returns true if the given name was specified on the command line.
For example, if C<@ARGS> was "C<< --foo --bar 10 >>" and C is defined by a
default, C<_specified> will return true for foo and bar, and false for baz.
=head2 _specified_opts
This method returns an opt object in which only explicitly specified values are
defined. Values which were set by defaults will appear undef.
=head2 _complete_opts
This method returns the opts object with all values, including those set by
defaults. It is probably not going to be very often-used.
=head1 AUTHORS
=over 4
=item *
Hans Dieter Pearcey
=item *
Ricardo Signes
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2005 by Hans Dieter Pearcey.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
Usage.pm 100644 000765 000024 21074 15145670555 24300 0 ustar 00rjbs staff 000000 000000 Getopt-Long-Descriptive-0.117/lib/Getopt/Long/Descriptive use strict;
use warnings;
package Getopt::Long::Descriptive::Usage 0.117;
# ABSTRACT: the usage description for GLD
use List::Util qw(max);
#pod =head1 SYNOPSIS
#pod
#pod use Getopt::Long::Descriptive;
#pod my ($opt, $usage) = describe_options( ... );
#pod
#pod $usage->text; # complete usage message
#pod
#pod $usage->die; # die with usage message
#pod
#pod =head1 DESCRIPTION
#pod
#pod This document only describes the methods of the Usage object. For information
#pod on how to use L, consult its documentation.
#pod
#pod =head1 METHODS
#pod
#pod =head2 new
#pod
#pod my $usage = Getopt::Long::Descriptive::Usage->new(\%arg);
#pod
#pod You B don't need to call this. GLD will do it for you.
#pod
#pod Valid arguments are:
#pod
#pod options - an arrayref of options
#pod leader_text - the text that leads the usage; this may go away!
#pod
#pod =cut
sub new {
my ($class, $arg) = @_;
my @to_copy = qw(leader_text options show_defaults);
my %copy;
@copy{ @to_copy } = @$arg{ @to_copy };
bless \%copy => $class;
}
#pod =head2 text
#pod
#pod This returns the full text of the usage message.
#pod
#pod =cut
sub text {
my ($self) = @_;
return join qq{\n}, $self->leader_text, $self->option_text;
}
#pod =head2 leader_text
#pod
#pod This returns the text that comes at the beginning of the usage message.
#pod
#pod =cut
sub leader_text { $_[0]->{leader_text} }
#pod =head2 option_text
#pod
#pod This returns the text describing the available options.
#pod
#pod =cut
sub option_text {
my ($self) = @_;
my $string = q{};
my @options = @{ $self->{options} || [] };
my @specs = map { $_->{spec} } grep { $_->{desc} ne 'spacer' } @options;
my $length = (max(map { _option_length($_) } @specs) || 0);
my $spec_fmt = " %-${length}s";
while (@options) {
my $opt = shift @options;
my $spec = $opt->{spec};
my $desc = $opt->{desc};
if ($desc eq 'spacer') {
if (ref $opt->{spec}) {
$string .= "${ $opt->{spec} }\n";
next;
} else {
my @lines = $self->_split_description(0, $opt->{spec});
$string .= length($_) ? sprintf("$spec_fmt\n", $_) : "\n" for @lines;
next;
}
}
($spec, my $assign) = Getopt::Long::Descriptive->_strip_assignment($spec);
my ($pre, $post) = _parse_assignment($assign);
my @names = split /\|/, $spec;
my $primary = shift @names;
my $short;
my ($i) = grep {; length $names[$_] == 1 } (0 .. $#names);
if (defined $i) {
$short = splice @names, $i, 1;
}
$spec = length $primary > 1 ? "--$pre$primary$post" : "-$primary$post";
$spec .= " (or -$short)" if $short;
my @desc = $self->_split_description($length, $desc);
if (@names) {
push @desc,
"aka " . join q{, }, map { length > 1 ? "--$_" : "-$_" } @names;
}
# add default value if it exists
if (exists $opt->{constraint}->{default} and $self->{show_defaults}) {
my $dflt = $opt->{constraint}->{default};
$dflt = ! defined $dflt ? '(undef)'
: ! length $dflt ? '(empty string)'
: $dflt;
push @desc, "(default value: $dflt)";
}
$string .= sprintf "$spec_fmt %s\n", $spec, shift @desc;
for my $line (@desc) {
$string .= " ";
$string .= q{ } x ( $length + 2 );
$string .= "$line\n";
}
}
return $string;
}
sub _option_length {
my ($fullspec) = @_;
my ($spec, $argspec) = Getopt::Long::Descriptive->_strip_assignment($fullspec);
my ($pre, $post) = _parse_assignment($argspec);
my @names = split /\|/, $spec;
my $primary = shift @names;
my $short = (@names && length $names[0] eq 1)
? shift @names
: undef;
$spec = length $primary > 1 ? "--$pre$primary$post" : "-$primary$post";
$spec .= " (or -$short)" if $short;
return length $spec;
}
sub _max_line_length {
return $Getopt::Long::Descriptive::TERM_WIDTH - 2;
}
sub _split_description {
my ($self, $length, $desc) = @_;
# 8 for a tab, 2 for the space between option & desc, 2 more for gutter
my $max_length = $self->_max_line_length - ( $length + 8 + 2 );
return $desc if length $desc <= $max_length;
my @lines;
while (length $desc > $max_length) {
my $idx = rindex( substr( $desc, 0, $max_length ), q{ }, );
last unless $idx >= 0;
push @lines, substr($desc, 0, $idx);
substr($desc, 0, $idx + 1) = q{};
}
push @lines, $desc;
return @lines;
}
sub _parse_assignment {
my ($assign_spec) = @_;
my $result = 'STR';
my $desttype;
if (length($assign_spec) < 2) {
# empty, ! or +
return ('[no-]', '') if $assign_spec eq '!';
return ('', '');
}
my $optional = substr($assign_spec, 0, 1) eq ':';
my $argument = substr $assign_spec, 1, 2;
if ($argument =~ m/^[io]/ or $assign_spec =~ m/^:[+0-9]/) {
$result = 'INT';
} elsif ($argument =~ m/^f/) {
$result = 'NUM';
}
if (length($assign_spec) > 2) {
$desttype = substr($assign_spec, 2, 1);
if ($desttype eq '@') {
# Imply it can be repeated
$result .= '...';
} elsif ($desttype eq '%') {
$result = "KEY=${result}...";
}
}
if ($optional) {
return ("", "[=$result]");
}
# with leading space so it can just blindly be appended.
return ("", " $result");
}
#pod =head2 warn
#pod
#pod This warns with the usage message.
#pod
#pod =cut
sub warn { warn shift->text }
#pod =head2 die
#pod
#pod This throws the usage message as an exception.
#pod
#pod $usage_obj->die(\%arg);
#pod
#pod Some arguments can be provided
#pod
#pod pre_text - text to be prepended to the usage message
#pod post_text - text to be appended to the usage message
#pod
#pod The C and C arguments are concatenated with the usage
#pod message with no line breaks, so supply this if you need them.
#pod
#pod =cut
sub die {
my $self = shift;
my $arg = shift || {};
die(
join q{}, grep { defined } $arg->{pre_text}, $self->text, $arg->{post_text}
);
}
use overload (
q{""} => "text",
# This is only needed because Usage used to be a blessed coderef that worked
# this way. Later we can toss a warning in here. -- rjbs, 2009-08-19
'&{}' => sub {
my ($self) = @_;
Carp::cluck("use of __PACKAGE__ objects as a code ref is deprecated");
return sub { return $_[0] ? $self->text : $self->warn; };
}
);
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Getopt::Long::Descriptive::Usage - the usage description for GLD
=head1 VERSION
version 0.117
=head1 SYNOPSIS
use Getopt::Long::Descriptive;
my ($opt, $usage) = describe_options( ... );
$usage->text; # complete usage message
$usage->die; # die with usage message
=head1 DESCRIPTION
This document only describes the methods of the Usage object. For information
on how to use L, consult its documentation.
=head1 PERL VERSION
This library should run on perls released even a long time ago. It should
work on any version of perl released in the last five years.
Although it may work on older versions of perl, no guarantee is made that the
minimum required version will not be increased. The version may be increased
for any reason, and there is no promise that patches will be accepted to
lower the minimum required perl.
=head1 METHODS
=head2 new
my $usage = Getopt::Long::Descriptive::Usage->new(\%arg);
You B don't need to call this. GLD will do it for you.
Valid arguments are:
options - an arrayref of options
leader_text - the text that leads the usage; this may go away!
=head2 text
This returns the full text of the usage message.
=head2 leader_text
This returns the text that comes at the beginning of the usage message.
=head2 option_text
This returns the text describing the available options.
=head2 warn
This warns with the usage message.
=head2 die
This throws the usage message as an exception.
$usage_obj->die(\%arg);
Some arguments can be provided
pre_text - text to be prepended to the usage message
post_text - text to be appended to the usage message
The C and C arguments are concatenated with the usage
message with no line breaks, so supply this if you need them.
=head1 AUTHORS
=over 4
=item *
Hans Dieter Pearcey
=item *
Ricardo Signes
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2005 by Hans Dieter Pearcey.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut