MooseX-Getopt-0.75/000755 000766 000024 00000000000 14024203060 014361 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/Build.PL000644 000766 000024 00000010702 14024203060 015655 0ustar00etherstaff000000 000000 # This Build.PL for MooseX-Getopt was generated by # Dist::Zilla::Plugin::ModuleBuildTiny::Fallback 0.025 use strict; use warnings; my %configure_requires = ( 'ExtUtils::MakeMaker' => '0', 'Module::Build::Tiny' => '0.034', ); my %errors = map { eval "require $_; $_->VERSION($configure_requires{$_}); 1"; $_ => $@, } keys %configure_requires; if (!grep { $_ } values %errors) { # This section for MooseX-Getopt was generated by Dist::Zilla::Plugin::ModuleBuildTiny 0.015. use strict; use warnings; use 5.006; # use Module::Build::Tiny 0.034; Module::Build::Tiny::Build_PL(); } else { if (not $ENV{PERL_MB_FALLBACK_SILENCE_WARNING}) { warn <<'EOW' *** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *** If you're seeing this warning, your toolchain is really, really old* and you'll almost certainly have problems installing CPAN modules from this century. But never fear, dear user, for we have the technology to fix this! If you're using CPAN.pm to install things, then you can upgrade it using: cpan CPAN If you're using CPANPLUS to install things, then you can upgrade it using: cpanp CPANPLUS If you're using cpanminus, you shouldn't be seeing this message in the first place, so please file an issue on github. This public service announcement was brought to you by the Perl Toolchain Gang, the irc.perl.org #toolchain IRC channel, and the number 42. ---- * Alternatively, you are running this file manually, in which case you need to learn to first fulfill all configure requires prerequisites listed in META.yml or META.json -- or use a cpan client to install this distribution. You can also silence this warning for future installations by setting the PERL_MB_FALLBACK_SILENCE_WARNING environment variable, but please don't do that until you fix your toolchain as described above. Errors from configure prereqs: EOW . do { require Data::Dumper; Data::Dumper->new([ \%errors ])->Indent(2)->Terse(1)->Sortkeys(1)->Dump; }; sleep 10 if -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); } # This section was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.017. use strict; use warnings; require Module::Build; Module::Build->VERSION(0.28); my %module_build_args = ( "configure_requires" => { "ExtUtils::MakeMaker" => 0, "Module::Build::Tiny" => "0.034", "perl" => "5.006" }, "dist_abstract" => "A Moose role for processing command line options", "dist_author" => [ "Stevan Little " ], "dist_name" => "MooseX-Getopt", "dist_version" => "0.75", "license" => "perl", "module_name" => "MooseX::Getopt", "recursive_test_files" => 1, "requires" => { "Carp" => 0, "Getopt::Long" => "2.37", "Getopt::Long::Descriptive" => "0.088", "Moose" => 0, "Moose::Meta::Attribute" => 0, "Moose::Role" => "0.56", "Moose::Util::TypeConstraints" => 0, "MooseX::Role::Parameterized" => "1.01", "Scalar::Util" => 0, "Try::Tiny" => 0, "namespace::autoclean" => 0, "perl" => "5.006", "strict" => 0, "warnings" => 0 }, "test_requires" => { "File::Spec" => 0, "Module::Metadata" => 0, "Module::Runtime" => 0, "Moose::Meta::Class" => 0, "Moose::Util" => 0, "Path::Tiny" => "0.009", "Test::Deep" => 0, "Test::Fatal" => "0.003", "Test::Moose" => 0, "Test::More" => "0.88", "Test::Needs" => 0, "Test::Trap" => 0, "Test::Warnings" => "0.009", "if" => 0, "perl" => "5.006" } ); my %fallback_build_requires = ( "File::Spec" => 0, "Module::Metadata" => 0, "Module::Runtime" => 0, "Moose::Meta::Class" => 0, "Moose::Util" => 0, "Path::Tiny" => "0.009", "Test::Deep" => 0, "Test::Fatal" => "0.003", "Test::Moose" => 0, "Test::More" => "0.88", "Test::Needs" => 0, "Test::Trap" => 0, "Test::Warnings" => "0.009", "if" => 0, "perl" => "5.006" ); unless ( eval { Module::Build->VERSION(0.4004) } ) { delete $module_build_args{test_requires}; $module_build_args{build_requires} = \%fallback_build_requires; } my $build = Module::Build->new(%module_build_args); $build->create_build_script; } MooseX-Getopt-0.75/INSTALL000644 000766 000024 00000004446 14024203060 015422 0ustar00etherstaff000000 000000 This is the Perl distribution MooseX-Getopt. Installing MooseX-Getopt is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm MooseX::Getopt If it does not have permission to install modules to the current perl, cpanm will automatically set up and install to a local::lib in your home directory. See the local::lib documentation (https://metacpan.org/pod/local::lib) for details on enabling it in your environment. ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan MooseX::Getopt ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, install configure prerequisites (see below), then build it: % perl Build.PL % ./Build && ./Build test Then install it: % ./Build install Or the more portable variation: % perl Build.PL % perl Build % perl Build test % perl Build install If your perl is system-managed, you can create a local::lib in your home directory to install modules to. For details, see the local::lib documentation: https://metacpan.org/pod/local::lib The prerequisites of this distribution will also have to be installed manually. The prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated by running the manual build process described above. ## Configure Prerequisites This distribution requires other modules to be installed before this distribution's installer can be run. They can be found under the "configure_requires" key of META.yml or the "{prereqs}{configure}{requires}" key of META.json. ## Other Prerequisites This distribution may require additional modules to be installed after running Build.PL or Makefile.PL. Look for prerequisites in the following phases: * to run ./Build or make, PHASE = build * to use the module code itself, PHASE = runtime * to run tests, PHASE = test They can all be found in the "PHASE_requires" key of MYMETA.yml or the "{prereqs}{PHASE}{requires}" key of MYMETA.json. ## Documentation MooseX-Getopt documentation is available as POD. You can run `perldoc` from a shell to read the documentation: % perldoc MooseX::Getopt For more information on installing Perl modules via CPAN, please see: https://www.cpan.org/modules/INSTALL.html MooseX-Getopt-0.75/LICENSE000644 000766 000024 00000043724 14024203060 015400 0ustar00etherstaff000000 000000 This software is copyright (c) 2007 by Infinity Interactive, Inc. 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) 2007 by Infinity Interactive, Inc. 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. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA 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 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2007 by Infinity Interactive, Inc. This is free software, licensed under: The 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. - "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 ftp.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) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting 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. 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 whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End MooseX-Getopt-0.75/CONTRIBUTING000644 000766 000024 00000010277 14024203060 016222 0ustar00etherstaff000000 000000 CONTRIBUTING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. PLEASE NOTE that if you have any questions or difficulties, you can reach the maintainer(s) through the bug queue described later in this document (preferred), or by emailing the releaser directly. You are not required to follow any of the steps in this document to submit a patch or bug report; these are just recommendations, intended to help you (and help us help you faster). This distribution has a TODO file in the repository; you may want to check there to see if your issue or patch idea is mentioned. The distribution is managed with Dist::Zilla (https://metacpan.org/release/Dist-Zilla). This means than many of the usual files you might expect are not in the repository, but are generated at release time (e.g. Makefile.PL). However, you can run tests directly using the 'prove' tool: $ prove -l $ prove -lv t/some_test_file.t $ prove -lvr t/ In most cases, 'prove' is entirely sufficient for you to test any patches you have. You may need to satisfy some dependencies. The easiest way to satisfy dependencies is to install the last release -- this is available at https://metacpan.org/release/MooseX-Getopt If you use cpanminus, you can do it without downloading the tarball first: $ cpanm --reinstall --installdeps --with-recommends MooseX::Getopt Dist::Zilla is a very powerful authoring tool, but requires a number of author-specific plugins. If you would like to use it for contributing, install it from CPAN, then run one of the following commands, depending on your CPAN client: $ cpan `dzil authordeps --missing` or $ dzil authordeps --missing | cpanm You should then also install any additional requirements not needed by the dzil build but may be needed by tests or other development: $ cpan `dzil listdeps --author --missing` or $ dzil listdeps --author --missing | cpanm Or, you can use the 'dzil stale' command to install all requirements at once: $ cpan Dist::Zilla::App::Command::stale $ cpan `dzil stale --all` or $ cpanm Dist::Zilla::App::Command::stale $ dzil stale --all | cpanm You can also do this via cpanm directly: $ cpanm --reinstall --installdeps --with-develop --with-recommends MooseX::Getopt Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil test --release $ dzil xtest $ dzil listdeps --json $ dzil build --notgz You can learn more about Dist::Zilla at http://dzil.org/. The code for this distribution is hosted at GitHub. The repository is: https://github.com/moose/MooseX-Getopt You can submit code changes by forking the repository, pushing your code changes to your clone, and then submitting a pull request. Please include a suitable end-user-oriented entry in the Changes file describing your change. Detailed instructions for doing that is available here: https://help.github.com/articles/creating-a-pull-request All pull requests for this distribution will be automatically tested on Linux by Travis at: https://travis-ci.com/moose/MooseX-Getopt Results will be visible in the pull request on GitHub. Follow the appropriate links for details when tests fail. Changes will not be mergeable until all tests pass. If you have found a bug, but do not have an accompanying patch to fix it, you can submit an issue report here: https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Getopt or via email: bug-MooseX-Getopt@rt.cpan.org There is also a mailing list available for users of this distribution, at http://lists.perl.org/list/moose.html There is also an irc channel available for users of this distribution, at irc://irc.perl.org/#moose If you send me a patch or pull request, your name and email address will be included in the documentation as a contributor (using the attribution on the commit or patch), unless you specifically request for it not to be. If you wish to be listed under a different name or address, you should submit a pull request to the .mailmap file to contain the correct mapping. This file was generated via Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.014 from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.159. MooseX-Getopt-0.75/Changes000600 000766 000024 00000033760 14024203060 015655 0ustar00etherstaff000000 000000 Revision history for MooseX-Getopt 0.75 2021-03-16 19:25:29Z - adjust tests to deal with formatting changes in Getopt::Long::Descriptive 0.106 (RT#134754) 0.74 2018-09-23 23:41:10Z - fix init_arg when used in combination with an underscored attribute read from the config file (Andreas Koenig, github #11) 0.73 2018-09-01 05:43:55Z - properly wrap usage text that contains newlines (Andreas Koenig, github #10) - move the exit() to a higher scope, to allow for 'after' method modifiers on 'print_usage_text' (Michael Schout, github #9) 0.72 2018-08-04 04:45:57Z - fix tests that broke with Getopt::Long::Descriptive 0.103 (RT#125992, Damyan Ivanov, debian-perl group) 0.71 2016-06-19 04:08:13Z - private attributes (i.e., lead "_) with a public init_arg now work. 0.70 2016-05-10 20:32:32Z - In 0.69, an undefined init_arg would cause warnings and exception. Attributes with an undefined init_arg are now ignored. (thanks, Greg Oschwald! -- PR #7) 0.69 2016-04-22 11:27:12Z - attributes' "init_arg" settings are now respected when retrieving command line options (thanks, Olaf Alders! -- PR#6) 0.68 2015-03-04 18:16:30Z - fix tests that look for the wrong prereqs (0.67) 0.67 2015-02-28 04:37:19Z - remove argv from passed-through buildargs if no argv attribute exists, to mollify MooseX::StrictConstructor (RT#101938, Jose Luis Martinez) 0.66 2015-01-28 02:05:54Z - fix tests for formatting changes in Getopt::Long::Descriptive 0.099 (RT#101724) 0.65 2014-08-06 06:09:04Z - re-release to remove README.pod from shipped dist 0.64 2014-08-02 17:35:20Z - bump required version of Getopt::Long::Descriptive to avoid an infinite loop problem (thanks, Bram!) 0.63 2014-03-25 16:37:58Z - fix test prereq on Test::Warnings (thanks, omega!) 0.62 2014-03-07 05:44:01Z - fix test that assumes option parsing is case-insensitive, which is no longer true with Getopt::Long::Descriptive 0.097 0.61 2014-02-11 06:30:14Z - fix potentially-broken check-breaks test when a conflicting module fails to compile 0.60 2014-02-10 02:21:05Z - avoid failing an optional test when YAML is not installed 0.59 2013-11-30 19:02:01Z - re-release to fix compile test 0.58 2013-09-13 16:57:41Z - remove use of deprecated $Config::Any::YAML::NO_YAML_XS_WARNING in tests - warnings tests bypassed during installation - author metadata moved to contributors 0.57 2013-09-07 21:29:05Z - spelling fixes (RT#87780, David Steinbrunner) - removed use of deprecated Class::MOP::load_class - repository migrated from shadowcat to the github moose organization 0.56 2013-02-15 21:13:18Z - depend on newest Path::Tiny, to regain 5.8.x compatibility (gone since v0.52) 0.55 2013-02-12 18:02:55Z - fix broken tests on win32 with file comparisons 0.54 2013-02-10 00:25:32Z - fix broken tests on win32 with file comparisons - allow configfiles called "0" - support more mechanisms for overriding default configfile - when using in conjunction with MooseX::ConfigFromFile, configfile value now properly passed to new() 0.53 2013-02-05 17:59:00Z - properly indicate optional dependency in tests using MooseX::ConfigFromFile 0.52 2013-02-03 03:01:25Z - tests converted from using Path::Class to Path::Tiny 0.51 2013-01-27 17:38:11Z - missing test prereqs now declared (thanks for the automated reports, David Cantrell!) 0.50 2012-12-27 08:20:56Z - unbreak Catalyst::Runtime tests (etc) by keeping _getopt_full_usage in the callstack. (RT#82249) 0.49 2012-12-26 18:13:41Z - silence a warning in tests if the user does not have YAML::XS installed (thanks for the report, Getty!) - fix off-by-one issues in test plans if optional requirements are not met 0.48 2012-12-24 02:08:04Z - documentation and tests amended to prefer usage of 'trait' over 'metaclass' as much as possible - print_usage_text() exposed as a public method, to make it easier for consuming classes to modify the behaviour when usage text is printed 0.47 2012-08-30 23:37:59Z - re-release to remove double $VERSION declarations 0.46 2012-08-30 22:17:28Z - -h is also treated as a --help option 0.45 2012-05-13 16:49:58Z - use Path::Class in test to avoid test failures on MSWin32 with filename construction 0.44 2012-05-11 17:44:48Z - now respecting value of configfile passed to the constructor, when used in conjunction with MooseX::ConfigFromFile. (Karen Etheridge) 0.43 2012-04-29 16:35:52Z - re-release as non-trial. 0.42 2012-04-15 16:13:05Z (TRIAL RELEASE) - reformatted the Changes file, with the help of CPAN::Changes, to something a little more standard. - more release-only tests added 0.41 2012-04-15 01:36:00Z (TRIAL RELEASE) - Now bails with exit status 0, rather than dying, when printing requested --usage/--help information (usage printed via invalid arguments will still die, however). (Karen Etheridge) 0.40 2012-04-13 - Fix tests when MooseX::ConfigFromFile is installed, with Getopt::Long::Descriptive >= 0.091. RT#76287 - Pod fix from debian. Salvatore Bonaccorso RT#74681 - Spelling fix from debian. Jonathan Yu RT#74681 0.39 2012-02-03 - Fix argument parsing in process_argv when used with ConfigFromFile so that -v can be used as expected, rather than being grabbed as --version 0.38 2011-12-23 - More documentation on Getopt::Long settings and how they alter this role's behaviour, in particular with regards to extra_argv capturing. (Karen Etheridge) 0.37 2011-03-30 - Fix missing dependency. (RT#67077) 0.36 2011-03-29 - Fix dist.ini 'Prereq' into 'Prereqs' (Damien Krotkine) - MooseX::Getopt::GLD - change it to a MooseX::Role::Parameterized, so that it accepts 'getopt_conf' parameter (Damien Krotkine) 0.35 2011-02-09 - Fix missed change from Test::Exception to Test::Fatal 0.34 2011-02-08 - The test suite now uses Test::Fatal instead of Test::Exception. (Karen Etheridge) - Move most of new_with_options logic into separate publically accessible process_argv method, so that arg processing can be done without actually creating object (Jonathan Swartz) 0.33 2010-08-26 - Remove Test::Most from newly added test (RT#60766) 0.32 2010-08-26 - Fix handling of Union types (RT#58417) 0.31 2010-07-07 - Fix issue causing tests to fail if MooseX::SimpleConfig isn't installed. 0.30 2010-07-06 - MooseX::Getopt::Basic - uses attribute insertion order when determining the order in which options are documented in the usage (e.g. in $obj->usage->text). (Karen Etheridge) - MooseX::Getopt::Basic - store the usage object to the usage attr (RT#58715) - properly checks whether the *option* --help, --usage, or --? were used, rather than the attribute 'help', 'usage' or '?' were set - MooseX::Getopt::GLD - add the usage attribute for storing the Getopt::Long::Descriptive::Usage object, and the help attribute for storing --help, --usage and --? state (RT#47865, RT#56783, RT#52474). (Karen Etheridge) - MooseX::Getopt::Basic - Disable auto_help config in Getopt::Long, to avoid calling into pod2usage when the --help option is used while MooseX::ConfigFromFile is in use (the intent is just to fetch the value of the configfile option) (RT#57683). (Karen Etheridge) 0.29 2010-06-15 - Fix repository metadata. Thanks Robert Bohne for noticing! 0.28 2010-06-05 - MooseX::Getopt::Strict - Make it work with Getopt attribute traits in addition to attribute metaclasses. - Switch from Module::Install to Dist::Zilla. 0.27 2010-02-10 - Makefile.PL - Bump dependency to Getopt::Long::Descriptive to 0.081 in an attempt to avoid test failures. - MooseX::Getopt::Dashes - Document that using a cmd_flag argument to attributes can be used to override the tr/_/-/ replacement ::Dashes does on attribute names 0.26 2009-12-10 - MooseX::Getopt::Basic - Fix bug with attribute names containing upper case letters. - Test suite - Add t/106_no_ignore_case.t for testing the compatibility with no_ignore_case 0.25 2009-11-26 - MooseX::Getopt - Split out the warnings and the exception from Getopt so that they can be overridden. - Split out calling ->die on Getopt::Long::Descriptive::Usage so that it can be overridden. - Properly split roles as promised in 0.22. 0.24 2009-10-23 - MooseX::Getopt - Fix bug with mixed case attribute names (MAROS) 0.23 2009-10-02 - MooseX::Getopt - Allow the config file to return a code ref which is called to return the config file location (Gordon Irving) 0.22 2009-09-05 - Require GLD 0.077 for RT#49427 as some versions are broken - MooseX::Getopt - Split into MooseX::Getopt::Basic (without the G::L::Descriptive support) and MooseX::Getopt::GLD. - Tests - Ensure author tests get run when in author mode. 0.21 2009-08-27 - MooseX::Getopt - Enable and document the argv parameter to the constructor. - Applied patches in RT43200 and RT43255 - Applied patch from RT#47766 to not die if SimpleConfig cannot find the default config file name. 0.20 2009-07-09 - fix MANIFEST.SKIP to avoid double-packaging 0.19 2009-07-08 - MooseX::Getopt - Fix Getopt config spec for --configfile (t0m) - Add support for --usage/--help/--? (drew@drewtaylor.com) - Fix new_with_options to accept a hashref (DOUGDUDE@cpan.org) - Tests - Fix warning from tests with new Moose (t0m) - Fix tests on Win32 from RT#44909 (taro-nishino) 0.18 2009-04-09 - MooseX::Getopt::Dashes - New module, for converting undercores to dashes (ilmari) 0.17 2009-04-08 - MooseX::Getopt - work with latest Moose (hdp) - unify module version numbers with dist version (hdp) 0.16 2009-02-17 - Tests - run pod tests only if RELEASE_TESTING env var is set 0.15 2008-07-26 - MooseX::Getopt::OptionTypeMap - Accept type constraint objects in the type mapping, not just names 0.14 2008-07-10 - MooseX::Getopt::OptionTypeMap - Change 'Float' which doesn't exist to 'Num' which does (perigrin) - MooseX::Getopt - removed the default handling with Getopt::Long::Descriptive as it would override constructor parameters and that was bad. Besides, Moose will just DWIM on this anyway. (stevan) - added test for it (stevan) - Tests - fixed Getopt::Long::Descriptive specific tests to only run if Getopt::Long::Descriptive is there (stevan) 0.13 2008-05-24 - MooseX::Getopt - Commandline option shouldn't be required in the case that the given "required" attribute has been loaded from config (MooseX::ConfigFromFile) - Support for MooseX::ConfigFromFile shouldn't require that role be added at the same level as Getopt. - fixed miscapitalization of NoGetopt in the docs - added links to the traits in the docs - converted to Module::Install instead of Module::Build 0.12 2008-03-14 - updated copyright dates - upped the Moose dependency to support the custom metaclass traits - added Getopt::Long::Descriptive as an optional dependency - MooseX::Getopt MooseX::Getopt::Meta::Attribute MooseX::Getopt::Meta::Attribute::Trait MooseX::Getopt::Meta::Attribute::NoGetopt MooseX::Getopt::Meta::Attribute::Trait::NoGetopt - added support for custom metaclass traits - added tests for this 0.11 2008-01-27 - MooseX::Getopt - Commandline option shouldn't be required in the case that the given "required" attribute has a default or a builder method. 0.10 2008-01-23 - MooseX::Getopt - Support default configfile attribute when used with MooseX::ConfigFromFile-based roles 0.09 2008-01-22 - MooseX::Getopt - Use Getopt::Long::Descriptive if it's available 0.08 2007-12-08 - MooseX::Getopt - Added support for configfile loading via MooseX::ConfigFromFile-based roles with the -configfile commandline option. 0.07 2007-12-04 - MooseX::Getopt::Meta::Attribute::NoGetopt - fixed miscapitalization of NoGetopt in the docs 0.06 2007-11-23 - MooseX::Getopt - refactored &new_with_option some so that this will work better with other Getopt modules (nuffin) - MooseX::Getopt::Strict - version of MooseX::Getopt which requires you to specify which attributes you want processed explicity - added tests for this - MooseX::Getopt::Meta::Attribute::NoGetopt - a custom meta-attribute which can be used to specify that an attribute should not be processed - added tests for this 0.05 2007-07-03 - MooseX::Getopt::OptionTypeMap - added some checks to make sure that the type constraints are found properly and to give better diagnostics 0.04 2007-06-26 - MooseX::Getopt::OptionTypeMap - Added support for subtype constraint inference from parent types - added tests and docs for this - MooseX::Getopt - Added extra_argv attribute - added tests and docs for this - We now unmangle the Getopt::Long-mangled @ARGV - added tests and docs for this - We now throw an exception from new_with_options if Getopt fails due to bad arguments. - added tests and docs for this 0.03 2007-05-02 - downgraded the Getopt version requirement to 2.35 as per RT #26844 - adding blblack to the authors list - MooseX::Getopt - doc update to show simple way to of excluding an attribute, but not having accessors with underscores (thanks to Zaba on #moose for this) - MooseX::Getopt::Meta::Attribute - tightening up the type constraint in the cmd_alias coercion to only accept strings 0.02 2007-04-06 - MooseX::Getopt - added the ARGV attribute (thanks to blblack) - added tests and docs for this - MooseX::Getopt::Meta::Attribute - added the cmd_aliases attribute (thanks to blblack) - added tests and docs for this - added support for Moose 0.19's custom attribute metaclass alias registry. - added tests and docs for this 0.01 2007-03-09 - module released to CPAN MooseX-Getopt-0.75/MANIFEST000644 000766 000024 00000003160 14024203060 015512 0ustar00etherstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.017. Build.PL CONTRIBUTING Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/MooseX/Getopt.pm lib/MooseX/Getopt/Basic.pm lib/MooseX/Getopt/Dashes.pm lib/MooseX/Getopt/GLD.pm lib/MooseX/Getopt/Meta/Attribute.pm lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm lib/MooseX/Getopt/Meta/Attribute/Trait.pm lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm lib/MooseX/Getopt/OptionTypeMap.pm lib/MooseX/Getopt/ProcessedArgv.pm lib/MooseX/Getopt/Strict.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/001_basic.t t/002_custom_option_type.t t/003_inferred_option_type.t t/004_nogetop.t t/005_strict.t t/006_metaclass_traits.t t/007_nogetopt_trait.t t/008_configfromfile.t t/009_gld_and_explicit_options.t t/010_dashes.t t/011_process_argv.t t/100_gld_default_bug.t t/101_argv_bug.t t/102_basic_basic.t t/103_uc_bug.t t/104_override_usage.t t/105_uc_bug_more.t t/106_no_ignore_case.t t/107_no_auto_help.t t/107_union_bug.t t/108_usage_attr.t t/109_help_flag.t t/110_sort_usage_by_attr_order.t t/111_gld_pass_through.t t/112_configfile_constructor_arg.t t/112_configfile_constructor_arg.yml t/113_moosex_strictconstructor.t t/114_init_arg.t t/zzz-check-breaks.t xt/author/00-compile.t xt/author/changes_has_content.t xt/author/clean-namespaces.t xt/author/distmeta.t xt/author/eol.t xt/author/kwalitee.t xt/author/minimum-version.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-no404s.t xt/author/pod-spell.t xt/author/pod-syntax.t xt/author/portability.t xt/release/changes_has_content.t xt/release/cpan-changes.t MooseX-Getopt-0.75/t/000755 000766 000024 00000000000 14024203060 014624 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/xt/000755 000766 000024 00000000000 14024203060 015014 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/README000644 000766 000024 00000000613 14024203060 015241 0ustar00etherstaff000000 000000 This archive contains the distribution MooseX-Getopt, version 0.75: A Moose role for processing command line options This software is copyright (c) 2007 by Infinity Interactive, Inc. 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.017. MooseX-Getopt-0.75/META.yml000644 000766 000024 00000077431 14024203060 015646 0ustar00etherstaff000000 000000 --- abstract: 'A Moose role for processing command line options' author: - 'Stevan Little ' build_requires: File::Spec: '0' Module::Metadata: '0' Module::Runtime: '0' Moose::Meta::Class: '0' Moose::Util: '0' Path::Tiny: '0.009' Test::Deep: '0' Test::Fatal: '0.003' Test::Moose: '0' Test::More: '0.88' Test::Needs: '0' Test::Trap: '0' Test::Warnings: '0.009' if: '0' perl: '5.006' configure_requires: ExtUtils::MakeMaker: '0' Module::Build::Tiny: '0.034' perl: '5.006' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010' keywords: - moose - extension - command - line - options - attributes - executable - flags - switches - arguments license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: MooseX-Getopt no_index: directory: - t - xt provides: MooseX::Getopt: file: lib/MooseX/Getopt.pm version: '0.75' MooseX::Getopt::Basic: file: lib/MooseX/Getopt/Basic.pm version: '0.75' MooseX::Getopt::Dashes: file: lib/MooseX/Getopt/Dashes.pm version: '0.75' MooseX::Getopt::GLD: file: lib/MooseX/Getopt/GLD.pm version: '0.75' MooseX::Getopt::Meta::Attribute: file: lib/MooseX/Getopt/Meta/Attribute.pm version: '0.75' MooseX::Getopt::Meta::Attribute::NoGetopt: file: lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm version: '0.75' MooseX::Getopt::Meta::Attribute::Trait: file: lib/MooseX/Getopt/Meta/Attribute/Trait.pm version: '0.75' MooseX::Getopt::Meta::Attribute::Trait::NoGetopt: file: lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm version: '0.75' MooseX::Getopt::OptionTypeMap: file: lib/MooseX/Getopt/OptionTypeMap.pm version: '0.75' MooseX::Getopt::ProcessedArgv: file: lib/MooseX/Getopt/ProcessedArgv.pm version: '0.75' MooseX::Getopt::Strict: file: lib/MooseX/Getopt/Strict.pm version: '0.75' requires: Carp: '0' Getopt::Long: '2.37' Getopt::Long::Descriptive: '0.088' Moose: '0' Moose::Meta::Attribute: '0' Moose::Role: '0.56' Moose::Util::TypeConstraints: '0' MooseX::Role::Parameterized: '1.01' Scalar::Util: '0' Try::Tiny: '0' namespace::autoclean: '0' perl: '5.006' strict: '0' warnings: '0' resources: IRC: irc://irc.perl.org/#moose MailingList: http://lists.perl.org/list/moose.html bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Getopt homepage: https://github.com/moose/MooseX-Getopt repository: https://github.com/moose/MooseX-Getopt.git version: '0.75' x_Dist_Zilla: perl: version: '5.033007' plugins: - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/pluginbundle version' version: '6.017' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::Author::ETHER phase: build run_under_travis: 0 skip: [] name: '@Author::ETHER/stale modules, build' version: '0.057' - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/Examples' version: '6.017' - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - CONTRIBUTING - INSTALL - LICENSE - README.pod - TODO exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@Author::ETHER/Git::GatherDir' version: '2.047' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ETHER/MetaYAML' version: '6.017' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::ETHER/MetaJSON' version: '6.017' - class: Dist::Zilla::Plugin::Readme name: '@Author::ETHER/Readme' version: '6.017' - class: Dist::Zilla::Plugin::Manifest name: '@Author::ETHER/Manifest' version: '6.017' - class: Dist::Zilla::Plugin::License name: '@Author::ETHER/License' version: '6.017' - class: Dist::Zilla::Plugin::GenerateFile::FromShareDir config: Dist::Zilla::Plugin::GenerateFile::FromShareDir: destination_filename: CONTRIBUTING dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 has_xs: 0 location: build source_filename: CONTRIBUTING Dist::Zilla::Role::RepoFileInjector: allow_overwrite: 1 repo_root: . version: '0.009' name: '@Author::ETHER/generate CONTRIBUTING' version: '0.014' - class: Dist::Zilla::Plugin::InstallGuide config: Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: '@Author::ETHER/InstallGuide' version: '1.200013' - 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' - '@Author::ETHER/Examples' skips: [] switch: [] name: '@Author::ETHER/Test::Compile' version: '2.058' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - '@Author::ETHER/Examples' - ':TestFiles' - ':ExtraTestFiles' name: '@Author::ETHER/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':ExtraTestFiles' - ':InstallModules' - ':TestFiles' - '@Author::ETHER/Examples' trailing_whitespace: 1 name: '@Author::ETHER/Test::EOL' version: '0.19' - class: Dist::Zilla::Plugin::MetaTests name: '@Author::ETHER/MetaTests' version: '6.017' - class: Dist::Zilla::Plugin::Test::CPAN::Changes config: Dist::Zilla::Plugin::Test::CPAN::Changes: changelog: Changes name: '@Author::ETHER/Test::CPAN::Changes' version: '0.012' - class: Dist::Zilla::Plugin::GenerateFile::FromShareDir config: Dist::Zilla::Plugin::GenerateFile::FromShareDir: destination_filename: xt/author/changes_has_content.t dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 location: build source_filename: changes_has_content.t Dist::Zilla::Role::RepoFileInjector: allow_overwrite: 1 repo_root: . version: '0.009' name: '@Author::ETHER/generate xt/author/changes_has_content.t' version: '0.014' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Author::ETHER/Test::ChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::Test::MinimumVersion config: Dist::Zilla::Plugin::Test::MinimumVersion: max_target_perl: '5.008003' name: '@Author::ETHER/Test::MinimumVersion' version: '2.000010' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ETHER/PodSyntaxTests' version: '6.017' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::ETHER/PodCoverageTests' version: '6.017' - class: Dist::Zilla::Plugin::Test::PodSpelling config: Dist::Zilla::Plugin::Test::PodSpelling: directories: - examples - lib - script - t - xt spell_cmd: '' stopwords: - irc wordlist: Pod::Wordlist name: '@Author::ETHER/Test::PodSpelling' version: '2.007005' - class: Dist::Zilla::Plugin::Test::Pod::No404s name: '@Author::ETHER/Test::Pod::No404s' version: '1.004' - class: Dist::Zilla::Plugin::Test::Kwalitee config: Dist::Zilla::Plugin::Test::Kwalitee: filename: xt/author/kwalitee.t skiptest: [] name: '@Author::ETHER/Test::Kwalitee' version: '2.12' - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::ETHER/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::ETHER/Test::ReportPrereqs' version: '0.028' - class: Dist::Zilla::Plugin::Test::Portability config: Dist::Zilla::Plugin::Test::Portability: options: '' name: '@Author::ETHER/Test::Portability' version: '2.001000' - class: Dist::Zilla::Plugin::Test::CleanNamespaces config: Dist::Zilla::Plugin::Test::CleanNamespaces: filename: xt/author/clean-namespaces.t skips: [] name: '@Author::ETHER/Test::CleanNamespaces' version: '0.006' - class: Dist::Zilla::Plugin::Git::Describe name: '@Author::ETHER/Git::Describe' version: '0.007' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@Author::ETHER' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@Author::ETHER/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@Author::ETHER/H1Nester' version: '4.015' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::ETHER/SingleEncoding' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/List' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@Author::ETHER/Verbatim' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/header' version: '4.015' - class: Pod::Weaver::Section::Name name: '@Author::ETHER/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@Author::ETHER/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.015' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.015' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.015' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.015' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.015' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.015' - class: Pod::Weaver::Section::Collect name: TYPES version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@Author::ETHER/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/postlude' version: '4.015' - class: Pod::Weaver::Section::GenerateSection name: '@Author::ETHER/generate SUPPORT' version: '1.06' - class: Pod::Weaver::Section::AllowOverride name: '@Author::ETHER/allow override SUPPORT' version: '0.05' - class: Pod::Weaver::Section::Authors name: '@Author::ETHER/Authors' version: '4.015' - class: Pod::Weaver::Section::AllowOverride name: '@Author::ETHER/allow override AUTHOR' version: '0.05' - class: Pod::Weaver::Section::Contributors name: '@Author::ETHER/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@Author::ETHER/Legal' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::ETHER/footer' version: '4.015' name: '@Author::ETHER/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::ETHER/GithubMeta' version: '0.58' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@Author::ETHER/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::Authority name: '@Author::ETHER/Authority' version: '1.009' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::ETHER/MetaNoIndex' version: '6.017' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder: - ':InstallModules' finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.017' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '0' inherit_version: '0' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: '@Author::ETHER/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ETHER/MetaConfig' version: '6.017' - class: Dist::Zilla::Plugin::Keywords config: Dist::Zilla::Plugin::Keywords: keywords: - moose - extension - command - line - options - attributes - executable - flags - switches - arguments name: '@Author::ETHER/Keywords' version: '0.007' - class: Dist::Zilla::Plugin::UseUnsafeInc config: Dist::Zilla::Plugin::UseUnsafeInc: dot_in_INC: 0 name: '@Author::ETHER/UseUnsafeInc' version: '0.001' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ETHER/AutoPrereqs' version: '6.017' - class: Dist::Zilla::Plugin::Prereqs::AuthorDeps name: '@Author::ETHER/Prereqs::AuthorDeps' version: '0.007' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::ETHER/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::MakeMaker::Fallback config: Dist::Zilla::Plugin::MakeMaker: make_path: make version: '6.017' Dist::Zilla::Plugin::MakeMaker::Awesome: version: '0.48' Dist::Zilla::Plugin::MakeMaker::Fallback: skip_release_testing: 0 Dist::Zilla::Role::TestRunner: default_jobs: 9 version: '6.017' name: '@Author::ETHER/MakeMaker::Fallback' version: '0.030' - class: Dist::Zilla::Plugin::ModuleBuildTiny::Fallback config: Dist::Zilla::Plugin::ModuleBuildTiny::Fallback: mb_version: '0.28' plugins: - class: Dist::Zilla::Plugin::ModuleBuild config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: 'ModuleBuild, via ModuleBuildTiny::Fallback' version: '6.017' - class: Dist::Zilla::Plugin::ModuleBuildTiny config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: 'ModuleBuildTiny, via ModuleBuildTiny::Fallback' version: '0.015' Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/ModuleBuildTiny::Fallback' version: '0.025' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.30.2 include_authors: 0 include_releaser: 1 order_by: commits paths: [] name: '@Author::ETHER/Git::Contributors' version: '0.036' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 0 mode: auto name: '@Author::ETHER/StaticInstall' version: '0.012' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@Author::ETHER/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: '@Author::ETHER/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 1 run: - "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" version: '0.048' name: '@Author::ETHER/.ackrc' version: '0.048' - class: Dist::Zilla::Plugin::Run::AfterBuild config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" fatal_errors: 0 quiet: 1 version: '0.048' name: '@Author::ETHER/.latest' version: '0.048' - class: Dist::Zilla::Plugin::CheckStrictVersion name: '@Author::ETHER/CheckStrictVersion' version: '0.001' - class: Dist::Zilla::Plugin::CheckMetaResources name: '@Author::ETHER/CheckMetaResources' version: '0.001' - class: Dist::Zilla::Plugin::EnsureLatestPerl config: Dist::Zilla::Plugin::EnsureLatestPerl: Module::CoreList: '5.20210220' name: '@Author::ETHER/EnsureLatestPerl' version: '0.008' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release run_under_travis: 0 skip: [] name: '@Author::ETHER/stale modules, release' version: '0.057' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.30.2 repo_root: . name: '@Author::ETHER/initial check' version: '2.047' - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts config: Dist::Zilla::Role::Git::Repo: git_version: 2.30.2 repo_root: . name: '@Author::ETHER/Git::CheckFor::MergeConflicts' version: '0.014' - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch config: Dist::Zilla::Role::Git::Repo: git_version: 2.30.2 repo_root: . name: '@Author::ETHER/Git::CheckFor::CorrectBranch' version: '0.014' - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@Author::ETHER/Git::Remote::Check' version: 0.1.2 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::ETHER/CheckPrereqsIndexed' version: '0.020' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ETHER/TestRelease' version: '6.017' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: [] allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.30.2 repo_root: . name: '@Author::ETHER/after tests' version: '2.047' - class: Dist::Zilla::Plugin::CheckIssues name: '@Author::ETHER/CheckIssues' version: '0.011' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ETHER/UploadToCPAN' version: '6.017' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - CONTRIBUTING - INSTALL - LICENCE - LICENSE - ppport.h match: [] name: '@Author::ETHER/copy generated files' version: '0.007' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::ETHER/ReadmeAnyFromPod' version: '0.163250' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/@Git::VersionManager/pluginbundle version' version: '6.017' - class: Dist::Zilla::Plugin::RewriteVersion::Transitional config: Dist::Zilla::Plugin::RewriteVersion: add_tarball_name: 0 finders: - ':ExecFiles' - ':InstallModules' global: 1 skip_version_provider: 0 Dist::Zilla::Plugin::RewriteVersion::Transitional: {} name: '@Author::ETHER/@Git::VersionManager/RewriteVersion::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::MetaProvides::Update name: '@Author::ETHER/@Git::VersionManager/MetaProvides::Update' version: '0.007' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - Changes match: [] name: '@Author::ETHER/@Git::VersionManager/CopyFilesFromRelease' version: '0.007' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: - . commit_msg: '%N-%v%t%n%n%c' signoff: 0 Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - CONTRIBUTING - Changes - INSTALL - LICENSE - README.pod allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.30.2 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/release snapshot' version: '2.047' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v0.75 tag_format: v%V tag_message: v%v%t Dist::Zilla::Role::Git::Repo: git_version: 2.30.2 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/Git::Tag' version: '2.047' - class: Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional config: Dist::Zilla::Plugin::BumpVersionAfterRelease: finders: - ':ExecFiles' - ':InstallModules' global: 1 munge_makefile_pl: 1 Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional: {} name: '@Author::ETHER/@Git::VersionManager/BumpVersionAfterRelease::Transitional' version: '0.009' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::ETHER/@Git::VersionManager/NextRelease' version: '6.017' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: 'increment $VERSION after %v release' signoff: 0 Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Build.PL - Changes - Makefile.PL allow_dirty_match: - (?^:^lib/.*\.pm$) changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.30.2 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::ETHER/@Git::VersionManager/post-release commit' version: '2.047' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: x_Dist_Zilla type: requires name: '@Author::ETHER/@Git::VersionManager/prereqs for @Git::VersionManager' version: '6.017' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.30.2 repo_root: . name: '@Author::ETHER/Git::Push' version: '2.047' - class: Dist::Zilla::Plugin::GitHub::Update config: Dist::Zilla::Plugin::GitHub::Update: metacpan: 1 name: '@Author::ETHER/GitHub::Update' version: '0.48' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 0 quiet: 0 run: - REDACTED version: '0.048' name: '@Author::ETHER/install release' version: '0.048' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: eval: - 'print "release complete!\xa"' fatal_errors: 1 quiet: 1 version: '0.048' name: '@Author::ETHER/release complete' version: '0.048' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ETHER/ConfirmRelease' version: '6.017' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: x_Dist_Zilla type: requires name: '@Author::ETHER/prereqs for @Author::ETHER' version: '6.017' - class: Dist::Zilla::Plugin::Prereqs::Soften config: Dist::Zilla::Plugin::Prereqs::Soften: copy_to: - develop.requires modules: - MooseX::SimpleConfig - MooseX::ConfigFromFile - YAML modules_from_features: ~ to_relationship: recommends name: Prereqs::Soften version: '0.006003' - class: Dist::Zilla::Plugin::Prereqs::Soften config: Dist::Zilla::Plugin::Prereqs::Soften: copy_to: - develop.requires modules: - MooseX::StrictConstructor modules_from_features: ~ to_relationship: suggests name: suggests version: '0.006003' - class: Dist::Zilla::Plugin::Test::CheckBreaks config: Dist::Zilla::Plugin::Test::CheckBreaks: conflicts_module: - Module::Runtime::Conflicts - Moose::Conflicts no_forced_deps: 0 Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000037' version: '0.006' name: Test::CheckBreaks version: '0.019' - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: '6.017' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: DevelopRequires version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.017' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.017' - class: Dist::Zilla::Plugin::VerifyPhases name: '@Author::ETHER/PHASE VERIFICATION' version: '0.016' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.017' x_authority: cpan:STEVAN x_contributors: - 'Karen Etheridge ' - 'Tomas Doran ' - 'Stevan Little ' - 'Yuval Kogman ' - 'Florian Ragwitz ' - 'Brandon L Black ' - 'Shlomi Fish ' - 'Hans Dieter Pearcey ' - 'Olaf Alders ' - 'Dave Rolsky ' - 'Nelo Onyiah ' - 'Ryan D Johnson ' - 'Ricardo SIGNES ' - 'Ævar Arnfjörð Bjarmason ' - 'Damien Krotkine ' - 'Hinrik Örn Sigurðsson ' - 'Chris Prather ' - 'Devin Austin ' - 'Gregory Oschwald ' - 'Jose Luis Martinez ' - 'Todd Hepler ' - 'Andreas Koenig ' - 'Andreas König ' - 'Dagfinn Ilmari Mannsåker ' - 'Damyan Ivanov ' - 'Drew Taylor ' - 'Gordon Irving ' - 'Jesse Luehrs ' - 'John Goulah ' - 'Jonathan Swartz ' - 'Justin Hunter ' - 'Michael Schout ' - 'Shlomi Fish ' - 'Stevan Little ' - 'Stuart A Johnston ' x_generated_by_perl: v5.33.7 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' x_static_install: 1 x_use_unsafe_inc: 0 MooseX-Getopt-0.75/lib/000755 000766 000024 00000000000 14024203060 015127 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/Makefile.PL000644 000766 000024 00000010661 14024203060 016337 0ustar00etherstaff000000 000000 # This Makefile.PL for MooseX-Getopt was generated by # Dist::Zilla::Plugin::MakeMaker::Fallback 0.030 # and Dist::Zilla::Plugin::MakeMaker::Awesome 0.48. # Don't edit it but the dist.ini and plugins used to construct it. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker; BEGIN { my %configure_requires = ( 'ExtUtils::MakeMaker' => '0', 'Module::Build::Tiny' => '0.034', ); my %errors = map { eval "require $_; $_->VERSION($configure_requires{$_}); 1"; $_ => $@, } keys %configure_requires; if (grep { $_ } values %errors) { warn "Errors from configure prereqs:\n" . do { require Data::Dumper; Data::Dumper->new([ \%errors ])->Indent(2)->Terse(1)->Sortkeys(1)->Dump; }; } if (not $ENV{PERL_MM_FALLBACK_SILENCE_WARNING}) { warn <<'EOW'; *** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *** If you're seeing this warning, your toolchain is really, really old* and you'll almost certainly have problems installing CPAN modules from this century. But never fear, dear user, for we have the technology to fix this! If you're using CPAN.pm to install things, then you can upgrade it using: cpan CPAN If you're using CPANPLUS to install things, then you can upgrade it using: cpanp CPANPLUS If you're using cpanminus, you shouldn't be seeing this message in the first place, so please file an issue on github. If you're using a packaging tool through a unix distribution, this issue should be reported to the package manager. If you're installing manually, please retrain your fingers to run Build.PL when present instead of Makefile.PL. This public service announcement was brought to you by the Perl Toolchain Gang, the irc.perl.org #toolchain IRC channel, and the number 42. ---- * Alternatively, you are doing something overly clever, in which case you should consider setting the 'prefer_installer' config option in CPAN.pm, or 'prefer_makefile' in CPANPLUS, to 'mb" and '0' respectively. You can also silence this warning for future installations by setting the PERL_MM_FALLBACK_SILENCE_WARNING environment variable. EOW sleep 10 if -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); } } # end BEGIN my %WriteMakefileArgs = ( "ABSTRACT" => "A Moose role for processing command line options", "AUTHOR" => "Stevan Little ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "Module::Build::Tiny" => "0.034" }, "DISTNAME" => "MooseX-Getopt", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "MooseX::Getopt", "PL_FILES" => {}, "PREREQ_PM" => { "Carp" => 0, "Getopt::Long" => "2.37", "Getopt::Long::Descriptive" => "0.088", "Moose" => 0, "Moose::Meta::Attribute" => 0, "Moose::Role" => "0.56", "Moose::Util::TypeConstraints" => 0, "MooseX::Role::Parameterized" => "1.01", "Scalar::Util" => 0, "Try::Tiny" => 0, "namespace::autoclean" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "Module::Metadata" => 0, "Module::Runtime" => 0, "Moose::Meta::Class" => 0, "Moose::Util" => 0, "Path::Tiny" => "0.009", "Test::Deep" => 0, "Test::Fatal" => "0.003", "Test::Moose" => 0, "Test::More" => "0.88", "Test::Needs" => 0, "Test::Trap" => 0, "Test::Warnings" => "0.009", "if" => 0 }, "VERSION" => "0.75", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "File::Spec" => 0, "Getopt::Long" => "2.37", "Getopt::Long::Descriptive" => "0.088", "Module::Metadata" => 0, "Module::Runtime" => 0, "Moose" => 0, "Moose::Meta::Attribute" => 0, "Moose::Meta::Class" => 0, "Moose::Role" => "0.56", "Moose::Util" => 0, "Moose::Util::TypeConstraints" => 0, "MooseX::Role::Parameterized" => "1.01", "Path::Tiny" => "0.009", "Scalar::Util" => 0, "Test::Deep" => 0, "Test::Fatal" => "0.003", "Test::Moose" => 0, "Test::More" => "0.88", "Test::Needs" => 0, "Test::Trap" => 0, "Test::Warnings" => "0.009", "Try::Tiny" => 0, "if" => 0, "namespace::autoclean" => 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); MooseX-Getopt-0.75/META.json000644 000766 000024 00000153270 14024203060 016012 0ustar00etherstaff000000 000000 { "abstract" : "A Moose role for processing command line options", "author" : [ "Stevan Little " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.017, CPAN::Meta::Converter version 2.150010", "keywords" : [ "moose", "extension", "command", "line", "options", "attributes", "executable", "flags", "switches", "arguments" ], "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "MooseX-Getopt", "no_index" : { "directory" : [ "t", "xt" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "Module::Build::Tiny" : "0.034", "perl" : "5.006" }, "suggests" : { "JSON::PP" : "2.27300" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Author::ETHER" : "0.159", "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007" }, "requires" : { "Dist::Zilla" : "5.000", "Encode" : "0", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "MooseX::ConfigFromFile" : "0", "MooseX::SimpleConfig" : "0", "MooseX::StrictConstructor" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Wordlist" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CleanNamespaces" : "0.15", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Pod::No404s" : "0", "Test::Portability::Files" : "0", "Test::Spelling" : "0.12", "Test::Warnings" : "0", "perl" : "5.006" } }, "runtime" : { "requires" : { "Carp" : "0", "Getopt::Long" : "2.37", "Getopt::Long::Descriptive" : "0.088", "Moose" : "0", "Moose::Meta::Attribute" : "0", "Moose::Role" : "0.56", "Moose::Util::TypeConstraints" : "0", "MooseX::Role::Parameterized" : "1.01", "Scalar::Util" : "0", "Try::Tiny" : "0", "namespace::autoclean" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900", "MooseX::ConfigFromFile" : "0", "MooseX::SimpleConfig" : "0" }, "requires" : { "File::Spec" : "0", "Module::Metadata" : "0", "Module::Runtime" : "0", "Moose::Meta::Class" : "0", "Moose::Util" : "0", "Path::Tiny" : "0.009", "Test::Deep" : "0", "Test::Fatal" : "0.003", "Test::Moose" : "0", "Test::More" : "0.88", "Test::Needs" : "0", "Test::Trap" : "0", "Test::Warnings" : "0.009", "if" : "0", "perl" : "5.006" }, "suggests" : { "MooseX::StrictConstructor" : "0" } }, "x_Dist_Zilla" : { "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::Authority" : "1.009", "Dist::Zilla::Plugin::AutoMetaResources" : "0", "Dist::Zilla::Plugin::AutoPrereqs" : "5.038", "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : "0.004", "Dist::Zilla::Plugin::CheckIssues" : "0", "Dist::Zilla::Plugin::CheckMetaResources" : "0", "Dist::Zilla::Plugin::CheckPrereqsIndexed" : "0.019", "Dist::Zilla::Plugin::CheckSelfDependency" : "0", "Dist::Zilla::Plugin::CheckStrictVersion" : "0", "Dist::Zilla::Plugin::ConfirmRelease" : "0", "Dist::Zilla::Plugin::CopyFilesFromRelease" : "0", "Dist::Zilla::Plugin::EnsureLatestPerl" : "0", "Dist::Zilla::Plugin::FileFinder::ByName" : "0", "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : "0", "Dist::Zilla::Plugin::Git::Check" : "0", "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch" : "0.004", "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts" : "0", "Dist::Zilla::Plugin::Git::Commit" : "2.020", "Dist::Zilla::Plugin::Git::Contributors" : "0.029", "Dist::Zilla::Plugin::Git::Describe" : "0.004", "Dist::Zilla::Plugin::Git::GatherDir" : "2.016", "Dist::Zilla::Plugin::Git::Push" : "0", "Dist::Zilla::Plugin::Git::Remote::Check" : "0", "Dist::Zilla::Plugin::Git::Tag" : "0", "Dist::Zilla::Plugin::GitHub::Update" : "0.40", "Dist::Zilla::Plugin::GithubMeta" : "0.54", "Dist::Zilla::Plugin::InstallGuide" : "1.200005", "Dist::Zilla::Plugin::Keywords" : "0.004", "Dist::Zilla::Plugin::License" : "5.038", "Dist::Zilla::Plugin::MakeMaker::Fallback" : "0.029", "Dist::Zilla::Plugin::Manifest" : "0", "Dist::Zilla::Plugin::MetaConfig" : "0", "Dist::Zilla::Plugin::MetaJSON" : "0", "Dist::Zilla::Plugin::MetaNoIndex" : "0", "Dist::Zilla::Plugin::MetaProvides::Package" : "1.15000002", "Dist::Zilla::Plugin::MetaResources" : "0", "Dist::Zilla::Plugin::MetaTests" : "0", "Dist::Zilla::Plugin::MetaYAML" : "0", "Dist::Zilla::Plugin::MinimumPerl" : "1.006", "Dist::Zilla::Plugin::ModuleBuildTiny::Fallback" : "0.018", "Dist::Zilla::Plugin::MojibakeTests" : "0.8", "Dist::Zilla::Plugin::NextRelease" : "5.033", "Dist::Zilla::Plugin::PodCoverageTests" : "5.040", "Dist::Zilla::Plugin::PodSyntaxTests" : "5.040", "Dist::Zilla::Plugin::PodWeaver" : "4.008", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::Prereqs::AuthorDeps" : "0.006", "Dist::Zilla::Plugin::Prereqs::Soften" : "0", "Dist::Zilla::Plugin::PromptIfStale" : "0", "Dist::Zilla::Plugin::Readme" : "0", "Dist::Zilla::Plugin::ReadmeAnyFromPod" : "0.142180", "Dist::Zilla::Plugin::RewriteVersion::Transitional" : "0.006", "Dist::Zilla::Plugin::Run::AfterBuild" : "0.041", "Dist::Zilla::Plugin::Run::AfterRelease" : "0.038", "Dist::Zilla::Plugin::RunExtraTests" : "0.024", "Dist::Zilla::Plugin::StaticInstall" : "0.005", "Dist::Zilla::Plugin::Test::CPAN::Changes" : "0.012", "Dist::Zilla::Plugin::Test::ChangesHasContent" : "0", "Dist::Zilla::Plugin::Test::CheckBreaks" : "0.017", "Dist::Zilla::Plugin::Test::CleanNamespaces" : "0.006", "Dist::Zilla::Plugin::Test::Compile" : "2.039", "Dist::Zilla::Plugin::Test::EOL" : "0.17", "Dist::Zilla::Plugin::Test::Kwalitee" : "2.10", "Dist::Zilla::Plugin::Test::MinimumVersion" : "2.000010", "Dist::Zilla::Plugin::Test::NoTabs" : "0.08", "Dist::Zilla::Plugin::Test::Pod::No404s" : "1.003", "Dist::Zilla::Plugin::Test::PodSpelling" : "2.006003", "Dist::Zilla::Plugin::Test::Portability" : "2.000007", "Dist::Zilla::Plugin::Test::ReportPrereqs" : "0.022", "Dist::Zilla::Plugin::TestRelease" : "0", "Dist::Zilla::Plugin::UploadToCPAN" : "0", "Dist::Zilla::Plugin::UseUnsafeInc" : "0", "Dist::Zilla::PluginBundle::Author::ETHER" : "0.117", "Dist::Zilla::PluginBundle::Git::VersionManager" : "0.007", "Software::License::Perl_5" : "0" } } }, "provides" : { "MooseX::Getopt" : { "file" : "lib/MooseX/Getopt.pm", "version" : "0.75" }, "MooseX::Getopt::Basic" : { "file" : "lib/MooseX/Getopt/Basic.pm", "version" : "0.75" }, "MooseX::Getopt::Dashes" : { "file" : "lib/MooseX/Getopt/Dashes.pm", "version" : "0.75" }, "MooseX::Getopt::GLD" : { "file" : "lib/MooseX/Getopt/GLD.pm", "version" : "0.75" }, "MooseX::Getopt::Meta::Attribute" : { "file" : "lib/MooseX/Getopt/Meta/Attribute.pm", "version" : "0.75" }, "MooseX::Getopt::Meta::Attribute::NoGetopt" : { "file" : "lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm", "version" : "0.75" }, "MooseX::Getopt::Meta::Attribute::Trait" : { "file" : "lib/MooseX/Getopt/Meta/Attribute/Trait.pm", "version" : "0.75" }, "MooseX::Getopt::Meta::Attribute::Trait::NoGetopt" : { "file" : "lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm", "version" : "0.75" }, "MooseX::Getopt::OptionTypeMap" : { "file" : "lib/MooseX/Getopt/OptionTypeMap.pm", "version" : "0.75" }, "MooseX::Getopt::ProcessedArgv" : { "file" : "lib/MooseX/Getopt/ProcessedArgv.pm", "version" : "0.75" }, "MooseX::Getopt::Strict" : { "file" : "lib/MooseX/Getopt/Strict.pm", "version" : "0.75" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-MooseX-Getopt@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Getopt" }, "homepage" : "https://github.com/moose/MooseX-Getopt", "repository" : { "type" : "git", "url" : "https://github.com/moose/MooseX-Getopt.git", "web" : "https://github.com/moose/MooseX-Getopt" }, "x_IRC" : "irc://irc.perl.org/#moose", "x_MailingList" : "http://lists.perl.org/list/moose.html" }, "version" : "0.75", "x_Dist_Zilla" : { "perl" : { "version" : "5.033007" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/pluginbundle version", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::Author::ETHER" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::ETHER/stale modules, build", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/Examples", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "CONTRIBUTING", "INSTALL", "LICENSE", "README.pod", "TODO" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@Author::ETHER/Git::GatherDir", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ETHER/MetaYAML", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::ETHER/MetaJSON", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ETHER/Readme", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ETHER/Manifest", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ETHER/License", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::FromShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { "destination_filename" : "CONTRIBUTING", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "has_xs" : 0, "location" : "build", "source_filename" : "CONTRIBUTING" }, "Dist::Zilla::Role::RepoFileInjector" : { "allow_overwrite" : 1, "repo_root" : ".", "version" : "0.009" } }, "name" : "@Author::ETHER/generate CONTRIBUTING", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "config" : { "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "@Author::ETHER/InstallGuide", "version" : "1.200013" }, { "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", "@Author::ETHER/Examples" ], "skips" : [], "switch" : [] } }, "name" : "@Author::ETHER/Test::Compile", "version" : "2.058" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", "@Author::ETHER/Examples", ":TestFiles", ":ExtraTestFiles" ] } }, "name" : "@Author::ETHER/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":ExtraTestFiles", ":InstallModules", ":TestFiles", "@Author::ETHER/Examples" ], "trailing_whitespace" : 1 } }, "name" : "@Author::ETHER/Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::ETHER/MetaTests", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "config" : { "Dist::Zilla::Plugin::Test::CPAN::Changes" : { "changelog" : "Changes" } }, "name" : "@Author::ETHER/Test::CPAN::Changes", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::FromShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::FromShareDir" : { "destination_filename" : "xt/author/changes_has_content.t", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "location" : "build", "source_filename" : "changes_has_content.t" }, "Dist::Zilla::Role::RepoFileInjector" : { "allow_overwrite" : 1, "repo_root" : ".", "version" : "0.009" } }, "name" : "@Author::ETHER/generate xt/author/changes_has_content.t", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Author::ETHER/Test::ChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "config" : { "Dist::Zilla::Plugin::Test::MinimumVersion" : { "max_target_perl" : 5.008003 } }, "name" : "@Author::ETHER/Test::MinimumVersion", "version" : "2.000010" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ETHER/PodSyntaxTests", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::ETHER/PodCoverageTests", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "config" : { "Dist::Zilla::Plugin::Test::PodSpelling" : { "directories" : [ "examples", "lib", "script", "t", "xt" ], "spell_cmd" : "", "stopwords" : [ "irc" ], "wordlist" : "Pod::Wordlist" } }, "name" : "@Author::ETHER/Test::PodSpelling", "version" : "2.007005" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", "name" : "@Author::ETHER/Test::Pod::No404s", "version" : "1.004" }, { "class" : "Dist::Zilla::Plugin::Test::Kwalitee", "config" : { "Dist::Zilla::Plugin::Test::Kwalitee" : { "filename" : "xt/author/kwalitee.t", "skiptest" : [] } }, "name" : "@Author::ETHER/Test::Kwalitee", "version" : "2.12" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@Author::ETHER/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::ETHER/Test::ReportPrereqs", "version" : "0.028" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "config" : { "Dist::Zilla::Plugin::Test::Portability" : { "options" : "" } }, "name" : "@Author::ETHER/Test::Portability", "version" : "2.001000" }, { "class" : "Dist::Zilla::Plugin::Test::CleanNamespaces", "config" : { "Dist::Zilla::Plugin::Test::CleanNamespaces" : { "filename" : "xt/author/clean-namespaces.t", "skips" : [] } }, "name" : "@Author::ETHER/Test::CleanNamespaces", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@Author::ETHER/Git::Describe", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@Author::ETHER" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@Author::ETHER/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@Author::ETHER/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::ETHER/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/List", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::ETHER/Verbatim", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/header", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::ETHER/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::ETHER/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "TYPES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::ETHER/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::GenerateSection", "name" : "@Author::ETHER/generate SUPPORT", "version" : "1.06" }, { "class" : "Pod::Weaver::Section::AllowOverride", "name" : "@Author::ETHER/allow override SUPPORT", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::ETHER/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::AllowOverride", "name" : "@Author::ETHER/allow override AUTHOR", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@Author::ETHER/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::ETHER/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::ETHER/footer", "version" : "4.015" } ] } }, "name" : "@Author::ETHER/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::ETHER/GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@Author::ETHER/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::ETHER/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::ETHER/MetaNoIndex", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder" : [ ":InstallModules" ], "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.017" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 0, "inherit_version" : 0, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "@Author::ETHER/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ETHER/MetaConfig", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Keywords", "config" : { "Dist::Zilla::Plugin::Keywords" : { "keywords" : [ "moose", "extension", "command", "line", "options", "attributes", "executable", "flags", "switches", "arguments" ] } }, "name" : "@Author::ETHER/Keywords", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::UseUnsafeInc", "config" : { "Dist::Zilla::Plugin::UseUnsafeInc" : { "dot_in_INC" : 0 } }, "name" : "@Author::ETHER/UseUnsafeInc", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ETHER/AutoPrereqs", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", "name" : "@Author::ETHER/Prereqs::AuthorDeps", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::ETHER/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::MakeMaker::Fallback", "config" : { "Dist::Zilla::Plugin::MakeMaker" : { "make_path" : "make", "version" : "6.017" }, "Dist::Zilla::Plugin::MakeMaker::Awesome" : { "version" : "0.48" }, "Dist::Zilla::Plugin::MakeMaker::Fallback" : { "skip_release_testing" : 0 }, "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9, "version" : "6.017" } }, "name" : "@Author::ETHER/MakeMaker::Fallback", "version" : "0.030" }, { "class" : "Dist::Zilla::Plugin::ModuleBuildTiny::Fallback", "config" : { "Dist::Zilla::Plugin::ModuleBuildTiny::Fallback" : { "mb_version" : "0.28", "plugins" : [ { "class" : "Dist::Zilla::Plugin::ModuleBuild", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "ModuleBuild, via ModuleBuildTiny::Fallback", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::ModuleBuildTiny", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "ModuleBuildTiny, via ModuleBuildTiny::Fallback", "version" : "0.015" } ] }, "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/ModuleBuildTiny::Fallback", "version" : "0.025" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.30.2", "include_authors" : 0, "include_releaser" : 1, "order_by" : "commits", "paths" : [] } }, "name" : "@Author::ETHER/Git::Contributors", "version" : "0.036" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 0, "mode" : "auto" } }, "name" : "@Author::ETHER/StaticInstall", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@Author::ETHER/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "@Author::ETHER/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 1, "run" : [ "bash -c \"test -e .ackrc && grep -q -- '--ignore-dir=.latest' .ackrc || echo '--ignore-dir=.latest' >> .ackrc; if [[ `dirname '%d'` != .build ]]; then test -e .ackrc && grep -q -- '--ignore-dir=%d' .ackrc || echo '--ignore-dir=%d' >> .ackrc; fi\"" ], "version" : "0.048" } }, "name" : "@Author::ETHER/.ackrc", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "if ('%d' =~ /^%n-[.[:xdigit:]]+$/) { unlink '.latest'; symlink '%d', '.latest'; }" ], "fatal_errors" : 0, "quiet" : 1, "version" : "0.048" } }, "name" : "@Author::ETHER/.latest", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::CheckStrictVersion", "name" : "@Author::ETHER/CheckStrictVersion", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CheckMetaResources", "name" : "@Author::ETHER/CheckMetaResources", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::EnsureLatestPerl", "config" : { "Dist::Zilla::Plugin::EnsureLatestPerl" : { "Module::CoreList" : "5.20210220" } }, "name" : "@Author::ETHER/EnsureLatestPerl", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 1, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [] } }, "name" : "@Author::ETHER/stale modules, release", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.2", "repo_root" : "." } }, "name" : "@Author::ETHER/initial check", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.2", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::MergeConflicts", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "config" : { "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.2", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::CheckFor::CorrectBranch", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@Author::ETHER/Git::Remote::Check", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::ETHER/CheckPrereqsIndexed", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ETHER/TestRelease", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.2", "repo_root" : "." } }, "name" : "@Author::ETHER/after tests", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::CheckIssues", "name" : "@Author::ETHER/CheckIssues", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ETHER/UploadToCPAN", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "CONTRIBUTING", "INSTALL", "LICENCE", "LICENSE", "ppport.h" ], "match" : [] } }, "name" : "@Author::ETHER/copy generated files", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::ETHER/ReadmeAnyFromPod", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/@Git::VersionManager/pluginbundle version", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::RewriteVersion::Transitional", "config" : { "Dist::Zilla::Plugin::RewriteVersion" : { "add_tarball_name" : 0, "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "skip_version_provider" : 0 }, "Dist::Zilla::Plugin::RewriteVersion::Transitional" : {} }, "name" : "@Author::ETHER/@Git::VersionManager/RewriteVersion::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Update", "name" : "@Author::ETHER/@Git::VersionManager/MetaProvides::Update", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "Changes" ], "match" : [] } }, "name" : "@Author::ETHER/@Git::VersionManager/CopyFilesFromRelease", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [ "." ], "commit_msg" : "%N-%v%t%n%n%c", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "CONTRIBUTING", "Changes", "INSTALL", "LICENSE", "README.pod" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.2", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/release snapshot", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v0.75", "tag_format" : "v%V", "tag_message" : "v%v%t" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.2", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/Git::Tag", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional", "config" : { "Dist::Zilla::Plugin::BumpVersionAfterRelease" : { "finders" : [ ":ExecFiles", ":InstallModules" ], "global" : 1, "munge_makefile_pl" : 1 }, "Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional" : {} }, "name" : "@Author::ETHER/@Git::VersionManager/BumpVersionAfterRelease::Transitional", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::ETHER/@Git::VersionManager/NextRelease", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "increment $VERSION after %v release", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Build.PL", "Changes", "Makefile.PL" ], "allow_dirty_match" : [ "(?^:^lib/.*\\.pm$)" ], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.2", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::ETHER/@Git::VersionManager/post-release commit", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "x_Dist_Zilla", "type" : "requires" } }, "name" : "@Author::ETHER/@Git::VersionManager/prereqs for @Git::VersionManager", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.30.2", "repo_root" : "." } }, "name" : "@Author::ETHER/Git::Push", "version" : "2.047" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "config" : { "Dist::Zilla::Plugin::GitHub::Update" : { "metacpan" : 1 } }, "name" : "@Author::ETHER/GitHub::Update", "version" : "0.48" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 0, "quiet" : 0, "run" : [ "REDACTED" ], "version" : "0.048" } }, "name" : "@Author::ETHER/install release", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "eval" : [ "print \"release complete!\\xa\"" ], "fatal_errors" : 1, "quiet" : 1, "version" : "0.048" } }, "name" : "@Author::ETHER/release complete", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ETHER/ConfirmRelease", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "x_Dist_Zilla", "type" : "requires" } }, "name" : "@Author::ETHER/prereqs for @Author::ETHER", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Prereqs::Soften", "config" : { "Dist::Zilla::Plugin::Prereqs::Soften" : { "copy_to" : [ "develop.requires" ], "modules" : [ "MooseX::SimpleConfig", "MooseX::ConfigFromFile", "YAML" ], "modules_from_features" : null, "to_relationship" : "recommends" } }, "name" : "Prereqs::Soften", "version" : "0.006003" }, { "class" : "Dist::Zilla::Plugin::Prereqs::Soften", "config" : { "Dist::Zilla::Plugin::Prereqs::Soften" : { "copy_to" : [ "develop.requires" ], "modules" : [ "MooseX::StrictConstructor" ], "modules_from_features" : null, "to_relationship" : "suggests" } }, "name" : "suggests", "version" : "0.006003" }, { "class" : "Dist::Zilla::Plugin::Test::CheckBreaks", "config" : { "Dist::Zilla::Plugin::Test::CheckBreaks" : { "conflicts_module" : [ "Module::Runtime::Conflicts", "Moose::Conflicts" ], "no_forced_deps" : 0 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000037", "version" : "0.006" } }, "name" : "Test::CheckBreaks", "version" : "0.019" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "DevelopRequires", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.017" }, { "class" : "Dist::Zilla::Plugin::VerifyPhases", "name" : "@Author::ETHER/PHASE VERIFICATION", "version" : "0.016" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.017" } }, "x_authority" : "cpan:STEVAN", "x_contributors" : [ "Karen Etheridge ", "Tomas Doran ", "Stevan Little ", "Yuval Kogman ", "Florian Ragwitz ", "Brandon L Black ", "Shlomi Fish ", "Hans Dieter Pearcey ", "Olaf Alders ", "Dave Rolsky ", "Nelo Onyiah ", "Ryan D Johnson ", "Ricardo SIGNES ", "\u00c6var Arnfj\u00f6r\u00f0 Bjarmason ", "Damien Krotkine ", "Hinrik \u00d6rn Sigur\u00f0sson ", "Chris Prather ", "Devin Austin ", "Gregory Oschwald ", "Jose Luis Martinez ", "Todd Hepler ", "Andreas Koenig ", "Andreas K\u00f6nig ", "Dagfinn Ilmari Manns\u00e5ker ", "Damyan Ivanov ", "Drew Taylor ", "Gordon Irving ", "Jesse Luehrs ", "John Goulah ", "Jonathan Swartz ", "Justin Hunter ", "Michael Schout ", "Shlomi Fish ", "Stevan Little ", "Stuart A Johnston " ], "x_generated_by_perl" : "v5.33.7", "x_serialization_backend" : "Cpanel::JSON::XS version 4.25", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_static_install" : 1, "x_use_unsafe_inc" : 0 } MooseX-Getopt-0.75/dist.ini000600 000766 000024 00000002013 14024203060 016011 0ustar00etherstaff000000 000000 name = MooseX-Getopt author = Stevan Little license = Perl_5 copyright_holder = Infinity Interactive, Inc copyright_year = 2007 [@Author::ETHER] :version = 0.117 authority = cpan:STEVAN -remove = Test::UnusedVars ; we like $class Test::ReportPrereqs.include = Dist::CheckConflicts Test::MinimumVersion.max_target_perl = 5.008003 StaticInstall.dry_run = 0 ; we can safely set this here ; these are only conditionally used - not a hard prereq [Prereqs::Soften] to_relationship = recommends copy_to = develop.requires module = MooseX::SimpleConfig module = MooseX::ConfigFromFile module = YAML [Prereqs::Soften / suggests] to_relationship = suggests copy_to = develop.requires module = MooseX::StrictConstructor [Test::CheckBreaks] :version = 0.017 conflicts_module = Moose::Conflicts conflicts_module = Module::Runtime::Conflicts [MetaResources] x_IRC = irc://irc.perl.org/#moose x_MailingList = http://lists.perl.org/list/moose.html [Prereqs / DevelopRequires] Test::Warnings = 0 Dist::Zilla = 5.000 MooseX-Getopt-0.75/lib/MooseX/000755 000766 000024 00000000000 14024203060 016341 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/lib/MooseX/Getopt/000755 000766 000024 00000000000 14024203060 017603 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/lib/MooseX/Getopt.pm000600 000766 000024 00000030316 14024203060 020134 0ustar00etherstaff000000 000000 package MooseX::Getopt; # git description: v0.74-5-g0d02d3b # ABSTRACT: A Moose role for processing command line options # KEYWORDS: moose extension command line options attributes executable flags switches arguments our $VERSION = '0.75'; use Moose::Role 0.56; use namespace::autoclean; with 'MooseX::Getopt::GLD'; 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt - A Moose role for processing command line options =head1 VERSION version 0.75 =head1 SYNOPSIS ## In your class package My::App; use Moose; with 'MooseX::Getopt'; has 'out' => (is => 'rw', isa => 'Str', required => 1); has 'in' => (is => 'rw', isa => 'Str', required => 1); # ... rest of the class here ## in your script #!/usr/bin/perl use My::App; my $app = My::App->new_with_options(); # ... rest of the script here ## on the command line % perl my_app_script.pl -in file.input -out file.dump =head1 DESCRIPTION This is a role which provides an alternate constructor for creating objects using parameters passed in from the command line. =head1 METHODS =head2 C<< new_with_options (%params) >> This method will take a set of default C<%params> and then collect parameters from the command line (possibly overriding those in C<%params>) and then return a newly constructed object. The special parameter C, if specified should point to an array reference with an array to use instead of C<@ARGV>. If L fails (due to invalid arguments), C will throw an exception. If L is installed and any of the following command line parameters are passed, the program will exit with usage information (and the option's state will be stored in the help_flag attribute). You can add descriptions for each option by including a B option for each attribute to document. -? --? -h --help --usage If you have L the C parameter is also passed to C as the usage option. =head2 C This accessor contains a reference to a copy of the C<@ARGV> array as it originally existed at the time of C. =head2 C This accessor contains an arrayref of leftover C<@ARGV> elements that L did not parse. Note that the real C<@ARGV> is left untouched. B: By default, L will reject unrecognized I (that is, options that do not correspond with attributes using the C trait). To disable this, and allow options to also be saved in C (for example to pass along to another class's C), you can either enable the C option of L for your class: C<< use Getopt::Long qw(:config pass_through); >> or specify a value for L's C parameter. =head2 C This accessor contains the L object (if L is used). =head2 C This accessor contains the boolean state of the --help, --usage and --? options (true if any of these options were passed on the command line). =head2 C This method is called internally when the C state is true. It prints the text from the C object (see above) to C (and then after this method is called, the program terminates normally). You can apply a method modification (see L) if different behaviour is desired, for example to include additional text. =head2 C This returns the role meta object. =head2 C This does most of the work of C, analyzing the parameters and C, except for actually calling the constructor. It returns a L object. C uses this method internally, so modifying this method via subclasses/roles will affect C. =for stopwords DWIM metaclass This module attempts to DWIM as much as possible with the command line parameters by introspecting your class's attributes. It will use the name of your attribute as the command line option, and if there is a type constraint defined, it will configure L to handle the option accordingly. You can use the trait L or the attribute metaclass L to get non-default command-line option names and aliases. You can use the trait L or the attribute metaclass L to have C ignore your attribute in the command-line options. By default, attributes which start with an underscore are not given command-line argument support, unless the attribute's metaclass is set to L. If you don't want your accessors to have the leading underscore in their name, you can do this: # for read/write attributes has '_foo' => (accessor => 'foo', ...); # or for read-only attributes has '_bar' => (reader => 'bar', ...); This will mean that MooseX::Getopt will not handle a --foo parameter, but your code can still call the C method. =for stopwords configfile If your class also uses a configfile-loading role based on L, such as L, L's C will load the configfile specified by the C<--configfile> option (or the default you've given for the configfile attribute) for you. Options specified in multiple places follow the following precedence order: command-line overrides configfile, which overrides explicit new_with_options parameters. =head2 Supported Type Constraints =over 4 =item I A I type constraint is set up as a boolean option with L. So that this attribute description: has 'verbose' => (is => 'rw', isa => 'Bool'); would translate into C as a L option descriptor, which would enable the following command line options: % my_script.pl --verbose % my_script.pl --noverbose =for stopwords Str =item I, I, I These type constraints are set up as properly typed options with L, using the C<=i>, C<=f> and C<=s> modifiers as appropriate. =item I An I type constraint is set up as a multiple value option in L. So that this attribute description: has 'include' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); would translate into C as a L option descriptor, which would enable the following command line options: % my_script.pl --include /usr/lib --include /usr/local/lib =item I A I type constraint is set up as a hash value option in L. So that this attribute description: has 'define' => ( is => 'rw', isa => 'HashRef', default => sub { {} } ); would translate into C as a L option descriptor, which would enable the following command line options: % my_script.pl --define os=linux --define vendor=debian =back =head2 Custom Type Constraints =for stopwords subtype It is possible to create custom type constraint to option spec mappings if you need them. The process is fairly simple (but a little verbose maybe). First you create a custom subtype, like so: subtype 'ArrayOfInts' => as 'ArrayRef' => where { scalar (grep { looks_like_number($_) } @$_) }; Then you register the mapping, like so: MooseX::Getopt::OptionTypeMap->add_option_type_to_map( 'ArrayOfInts' => '=i@' ); Now any attribute declarations using this type constraint will get the custom option spec. So that, this: has 'nums' => ( is => 'ro', isa => 'ArrayOfInts', default => sub { [0] } ); Will translate to the following on the command line: % my_script.pl --nums 5 --nums 88 --nums 199 This example is fairly trivial, but more complex validations are easily possible with a little creativity. The trick is balancing the type constraint validations with the L validations. Better examples are certainly welcome :) =head2 Inferred Type Constraints If you define a custom subtype which is a subtype of one of the standard L above, and do not explicitly provide custom support as in L above, MooseX::Getopt will treat it like the parent type for Getopt purposes. For example, if you had the same custom C subtype from the examples above, but did not add a new custom option type for it to the C, it would be treated just like a normal C type for Getopt purposes (that is, C<=s@>). =head2 More Customization Options =for stopwords customizations See L for many other customizations you can make to how options are parsed. Simply C in your class to set these. Note in particular that the default setting for case sensitivity has changed over time in L, so if you rely on a particular setting, you should set it explicitly, or enforce the version of L that you install. =head1 SEE ALSO =over 4 =item * L, an extension to generate man pages, with colour =item * L, similar functionality for L =back =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 CONTRIBUTORS =for stopwords Karen Etheridge Tomas Doran Stevan Little Yuval Kogman Florian Ragwitz Brandon L Black Shlomi Fish Hans Dieter Pearcey Olaf Alders Dave Rolsky Nelo Onyiah Ryan D Johnson Ricardo SIGNES Ævar Arnfjörð Bjarmason Damien Krotkine Hinrik Örn Sigurðsson Chris Prather Devin Austin Gregory Oschwald Jose Luis Martinez Todd Hepler Andreas Koenig König Dagfinn Ilmari Mannsåker Damyan Ivanov Drew Taylor Gordon Irving Jesse Luehrs John Goulah Jonathan Swartz Justin Hunter Michael Schout Stuart A Johnston =over 4 =item * Karen Etheridge =item * Tomas Doran =item * Stevan Little =item * Yuval Kogman =item * Florian Ragwitz =item * Brandon L Black =item * Shlomi Fish =item * Hans Dieter Pearcey =item * Olaf Alders =item * Dave Rolsky =item * Nelo Onyiah =item * Ryan D Johnson =item * Ricardo SIGNES =item * Ævar Arnfjörð Bjarmason =item * Damien Krotkine =item * Hinrik Örn Sigurðsson =item * Chris Prather =item * Devin Austin =item * Gregory Oschwald =item * Jose Luis Martinez =item * Todd Hepler =item * Andreas Koenig =item * Andreas König =item * Dagfinn Ilmari Mannsåker =item * Damyan Ivanov =item * Drew Taylor =item * Gordon Irving =item * Jesse Luehrs =item * John Goulah =item * Jonathan Swartz =item * Justin Hunter =item * Michael Schout =item * Shlomi Fish =item * Stevan Little =item * Stuart A Johnston =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/OptionTypeMap.pm000644 000766 000024 00000007375 14024203060 022725 0ustar00etherstaff000000 000000 package MooseX::Getopt::OptionTypeMap; # ABSTRACT: Storage for the option to type mappings our $VERSION = '0.75'; use Moose; use Carp 'confess'; use Scalar::Util 'blessed'; use Moose::Util::TypeConstraints 'find_type_constraint'; use namespace::autoclean; my %option_type_map = ( 'Bool' => '!', 'Str' => '=s', 'Int' => '=i', 'Num' => '=f', 'ArrayRef' => '=s@', 'HashRef' => '=s%', ); sub has_option_type { my (undef, $type_or_name) = @_; if (blessed($type_or_name) && $type_or_name->isa('Moose::Meta::TypeConstraint::Union')) { foreach my $union_type (@{$type_or_name->type_constraints}) { return 1 if __PACKAGE__->has_option_type($union_type); } return 0; } return 1 if exists $option_type_map{blessed($type_or_name) ? $type_or_name->name : $type_or_name}; my $current = blessed($type_or_name) ? $type_or_name : find_type_constraint($type_or_name); (defined $current) || confess "Could not find the type constraint for '$type_or_name'"; while (my $parent = $current->parent) { return 1 if exists $option_type_map{$parent->name}; $current = $parent; } return 0; } sub get_option_type { my (undef, $type_or_name) = @_; if (blessed($type_or_name) && $type_or_name->isa('Moose::Meta::TypeConstraint::Union')) { foreach my $union_type (@{$type_or_name->type_constraints}) { my $option_type = __PACKAGE__->get_option_type($union_type); return $option_type if defined $option_type; } return; } my $name = blessed($type_or_name) ? $type_or_name->name : $type_or_name; return $option_type_map{$name} if exists $option_type_map{$name}; my $current = ref $type_or_name ? $type_or_name : find_type_constraint($type_or_name); (defined $current) || confess "Could not find the type constraint for '$type_or_name'"; while ( $current = $current->parent ) { return $option_type_map{$current->name} if exists $option_type_map{$current->name}; } return; } sub add_option_type_to_map { my (undef, $type_name, $option_string) = @_; (defined $type_name && defined $option_string) || confess "You must supply both a type name and an option string"; if ( blessed($type_name) ) { $type_name = $type_name->name; } else { (find_type_constraint($type_name)) || confess "The type constraint '$type_name' does not exist"; } $option_type_map{$type_name} = $option_string; } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::OptionTypeMap - Storage for the option to type mappings =head1 VERSION version 0.75 =head1 DESCRIPTION See the I section in the L docs for more info about how to use this module. =head1 METHODS =head2 B =head2 B =head2 B =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/Dashes.pm000644 000766 000024 00000004426 14024203060 021356 0ustar00etherstaff000000 000000 package MooseX::Getopt::Dashes; # ABSTRACT: convert underscores in attribute names to dashes our $VERSION = '0.75'; use Moose::Role; with 'MooseX::Getopt'; use namespace::autoclean; around _get_cmd_flags_for_attr => sub { my $next = shift; my ( $class, $attr, @rest ) = @_; my ( $flag, @aliases ) = $class->$next($attr, @rest); $flag =~ tr/_/-/ unless $attr->does('MooseX::Getopt::Meta::Attribute::Trait') && $attr->has_cmd_flag; return ( $flag, @aliases ); }; 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::Dashes - convert underscores in attribute names to dashes =head1 VERSION version 0.75 =head1 SYNOPSIS package My::App; use Moose; with 'MooseX::Getopt::Dashes'; # Will be called as --some-thingy, not --some_thingy has 'some_thingy' => ( is => 'ro', isa => 'Str', default => 'foo' ); # Will be called as --another_thingy, not --another-thingy has 'another_thingy' => ( traits => [ 'Getopt' ], cmd_flag => 'another_thingy' is => 'ro', isa => 'Str', default => 'foo' ); # use as MooseX::Getopt =head1 DESCRIPTION This is a version of L which converts underscores in attribute names to dashes when generating command line flags. You can selectively disable this on a per-attribute basis by supplying a L argument with the command flag you'd like for a given attribute. No underscore to dash replacement will be done on the C. =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/Strict.pm000644 000766 000024 00000002765 14024203060 021423 0ustar00etherstaff000000 000000 package MooseX::Getopt::Strict; # ABSTRACT: only make options for attributes with the Getopt metaclass our $VERSION = '0.75'; use Moose::Role; use namespace::autoclean; with 'MooseX::Getopt'; around '_compute_getopt_attrs' => sub { my $next = shift; my ( $class, @args ) = @_; grep { $_->does("MooseX::Getopt::Meta::Attribute::Trait") } $class->$next(@args); }; 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::Strict - only make options for attributes with the Getopt metaclass =head1 VERSION version 0.75 =head1 DESCRIPTION This is an stricter version of C which only processes the attributes if they explicitly set as C attributes. All other attributes are ignored by the command line handler. =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/Meta/000755 000766 000024 00000000000 14024203060 020471 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/lib/MooseX/Getopt/Basic.pm000600 000766 000024 00000024273 14024203060 021162 0ustar00etherstaff000000 000000 package MooseX::Getopt::Basic; # ABSTRACT: MooseX::Getopt::Basic - role to implement the Getopt::Long functionality our $VERSION = '0.75'; use Moose::Role; use MooseX::Getopt::OptionTypeMap; use MooseX::Getopt::Meta::Attribute; use MooseX::Getopt::Meta::Attribute::NoGetopt; use MooseX::Getopt::ProcessedArgv; use Try::Tiny; use Carp (); use Getopt::Long 2.37 (); use namespace::autoclean; has ARGV => (is => 'rw', isa => 'ArrayRef', traits => ['NoGetopt']); has extra_argv => (is => 'rw', isa => 'ArrayRef', traits => ['NoGetopt']); sub process_argv { my ($class, @params) = @_; my $constructor_params = ( @params == 1 ? $params[0] : {@params} ); my $config_from_file; if($class->meta->does_role('MooseX::ConfigFromFile')) { local @ARGV = @ARGV; # just get the configfile arg now out of @ARGV; the rest of the args # will be fetched later my $configfile; my $opt_parser = Getopt::Long::Parser->new( config => [ qw( no_auto_help pass_through no_auto_version ) ] ); $opt_parser->getoptions( "configfile=s" => \$configfile ); my $cfmeta = $class->meta->find_attribute_by_name('configfile'); my $init_arg = $cfmeta->init_arg; # was it passed to the constructor? if (!defined $configfile) { $configfile = $constructor_params->{$init_arg} if defined $init_arg; } if(!defined $configfile) { # this is a classic legacy usecase documented in # MooseX::ConfigFromFile that we should continue to support $configfile = try { $class->configfile }; $configfile = $cfmeta->default if not defined $configfile and $cfmeta->has_default; # note that this will die horribly if the default sub depends on # other attributes $configfile = $configfile->($class) if ref $configfile eq 'CODE'; if (defined $configfile) { $config_from_file = try { $class->get_config_from_file($configfile); } catch { die $_ unless /Specified configfile '\Q$configfile\E' does not exist/; }; } $constructor_params->{$init_arg} = $configfile if defined $configfile and defined $init_arg; } else { $config_from_file = $class->get_config_from_file($configfile); } } Carp::croak("Single parameters to new_with_options() must be a HASH ref") unless ref($constructor_params) eq 'HASH'; my %processed = $class->_parse_argv( options => [ $class->_attrs_to_options( $config_from_file ) ], params => $config_from_file ? { %$config_from_file, %$constructor_params } : $constructor_params, ); my $params = $config_from_file ? { %$config_from_file, %{$processed{params}} } : $processed{params}; # did the user request usage information? if ( $processed{usage} and $params->{help_flag} ) { $class->print_usage_text($processed{usage}); exit 0; } return MooseX::Getopt::ProcessedArgv->new( argv_copy => $processed{argv_copy}, extra_argv => $processed{argv}, usage => $processed{usage}, constructor_params => $constructor_params, # explicit params to ->new cli_params => $params, # params from CLI ); } sub new_with_options { my ($class, @params) = @_; my $pa = $class->process_argv(@params); # $pa->constructor_params contains everything passed to new_with_options, # so it may contain the "argv" key, which may not exist on the class my %constructor_params = %{ $pa->constructor_params }; delete $constructor_params{argv} if (not $class->meta->find_attribute_by_name('argv')); $class->new( ARGV => $pa->argv_copy, extra_argv => $pa->extra_argv, ( $pa->usage ? ( usage => $pa->usage ) : () ), %constructor_params, # explicit params to ->new %{ $pa->cli_params }, # params from CLI ); } sub _getopt_spec { shift->_traditional_spec(@_); } sub _parse_argv { my ( $class, %params ) = @_; local @ARGV = @{ $params{params}{argv} || \@ARGV }; my ( $opt_spec, $name_to_init_arg ) = $class->_getopt_spec(%params); # Get a clean copy of the original @ARGV my $argv_copy = [ @ARGV ]; my @warnings; my ( $parsed_options, $usage ) = try { local $SIG{__WARN__} = sub { push @warnings, @_ }; return $class->_getopt_get_options(\%params, $opt_spec); } catch { $class->_getopt_spec_exception(\@warnings, $_); }; $class->_getopt_spec_warnings(@warnings) if @warnings; # Get a copy of the Getopt::Long-mangled @ARGV my $argv_mangled = [ @ARGV ]; my %constructor_args = ( map { $name_to_init_arg->{$_} => $parsed_options->{$_} } keys %$parsed_options, ); return ( params => \%constructor_args, argv_copy => $argv_copy, argv => $argv_mangled, ( defined($usage) ? ( usage => $usage ) : () ), ); } sub _getopt_get_options { my ($class, $params, $opt_spec) = @_; my %options; Getopt::Long::GetOptions(\%options, @$opt_spec); return ( \%options, undef ); } sub _getopt_spec_warnings { } sub _getopt_spec_exception { my ($self, $warnings, $exception) = @_; die @$warnings, $exception; } # maintained for backwards compatibility only sub _getopt_full_usage { my ($self, $usage) = @_; print $usage->text; } #(this is already documented in MooseX::Getopt. But FIXME later, via RT#82195) #pod =for Pod::Coverage #pod print_usage_text #pod =cut sub print_usage_text { shift->_getopt_full_usage(@_) } sub _usage_format { return "usage: %c %o"; } sub _traditional_spec { my ( $class, %params ) = @_; my ( @options, %name_to_init_arg ); foreach my $opt ( @{ $params{options} } ) { push @options, $opt->{opt_string}; my $identifier = $opt->{name}; $identifier =~ s/\W/_/g; # Getopt::Long does this to all option names $name_to_init_arg{$identifier} = $opt->{init_arg}; } return ( \@options, \%name_to_init_arg ); } sub _compute_getopt_attrs { my $class = shift; sort { $a->insertion_order <=> $b->insertion_order } grep { $_->does("MooseX::Getopt::Meta::Attribute::Trait") or $_->init_arg !~ /^_/ } grep { defined $_->init_arg } grep { !$_->does('MooseX::Getopt::Meta::Attribute::Trait::NoGetopt') } $class->meta->get_all_attributes } sub _get_cmd_flags_for_attr { my ( $class, $attr ) = @_; my $flag = $attr->init_arg; my @aliases; if ($attr->does('MooseX::Getopt::Meta::Attribute::Trait')) { $flag = $attr->cmd_flag if $attr->has_cmd_flag; @aliases = @{ $attr->cmd_aliases } if $attr->has_cmd_aliases; } return ( $flag, @aliases ); } sub _attrs_to_options { my $class = shift; my $config_from_file = shift || {}; my @options; foreach my $attr ($class->_compute_getopt_attrs) { my ( $flag, @aliases ) = $class->_get_cmd_flags_for_attr($attr); my $opt_string = join(q{|}, $flag, @aliases); if ($attr->name eq 'configfile') { $opt_string .= '=s'; } elsif ($attr->has_type_constraint) { my $type = $attr->type_constraint; if (MooseX::Getopt::OptionTypeMap->has_option_type($type)) { $opt_string .= MooseX::Getopt::OptionTypeMap->get_option_type($type) } } my $push = { name => $flag, init_arg => $attr->init_arg, opt_string => $opt_string, required => $attr->is_required && !$attr->has_default && !$attr->has_builder && !exists $config_from_file->{$attr->name}, # NOTE: # this "feature" was breaking because # Getopt::Long::Descriptive would return # the default value as if it was a command # line flag, which would then override the # one passed into a constructor. # See 100_gld_default_bug.t for an example # - SL #( ( $attr->has_default && ( $attr->is_default_a_coderef xor $attr->is_lazy ) ) ? ( default => $attr->default({}) ) : () ), }; if ($attr->has_documentation) { my $doc = $attr->documentation; $doc =~ s/[\r\n]+/ /g; $push->{doc} = $doc; } push @options, $push; } return @options; } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::Basic - MooseX::Getopt::Basic - role to implement the Getopt::Long functionality =head1 VERSION version 0.75 =head1 SYNOPSIS ## In your class package My::App; use Moose; with 'MooseX::Getopt::Basic'; has 'out' => (is => 'rw', isa => 'Str', required => 1); has 'in' => (is => 'rw', isa => 'Str', required => 1); # ... rest of the class here ## in your script #!/usr/bin/perl use My::App; my $app = My::App->new_with_options(); # ... rest of the script here ## on the command line % perl my_app_script.pl --in file.input --out file.dump =head1 DESCRIPTION This is like L and can be used instead except that it doesn't make use of L (or "GLD" for short). =head1 METHODS =head2 new_with_options See L. =head2 process_argv See L. =for Pod::Coverage print_usage_text =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/GLD.pm000644 000766 000024 00000010316 14024203060 020550 0ustar00etherstaff000000 000000 package MooseX::Getopt::GLD; # ABSTRACT: A Moose role for processing command line options with Getopt::Long::Descriptive our $VERSION = '0.75'; use strict; use warnings; use MooseX::Role::Parameterized 1.01; use Getopt::Long::Descriptive 0.088; with 'MooseX::Getopt::Basic'; use namespace::autoclean; parameter getopt_conf => ( isa => 'ArrayRef[Str]', default => sub { [] }, ); role { my $p = shift; my $getopt_conf = $p->getopt_conf; has usage => ( is => 'rw', isa => 'Getopt::Long::Descriptive::Usage', traits => ['NoGetopt'], ); # captures the options: --help --usage --? -? -h has help_flag => ( is => 'ro', traits => ['Getopt'], cmd_flag => 'help', cmd_aliases => [ qw(usage ? h) ], documentation => 'Prints this usage information.', ); around _getopt_spec => sub { shift; shift->_gld_spec(@_); }; around _getopt_get_options => sub { shift; my ($class, $params, $opt_spec) = @_; # Check if a special args hash were already passed, or create a new one my $args = ref($opt_spec->[-1]) eq 'HASH' ? pop @$opt_spec : {}; unshift @{$args->{getopt_conf}}, @$getopt_conf; push @$opt_spec, $args; return Getopt::Long::Descriptive::describe_options($class->_usage_format(%$params), @$opt_spec); }; method _gld_spec => sub { my ( $class, %params ) = @_; my ( @options, %name_to_init_arg ); my $constructor_params = $params{params}; foreach my $opt ( @{ $params{options} } ) { push @options, [ $opt->{opt_string}, $opt->{doc} || ' ', # FIXME new GLD shouldn't need this hack { ( ( $opt->{required} && !exists($constructor_params->{$opt->{init_arg}}) ) ? (required => $opt->{required}) : () ), # NOTE: # remove this 'feature' because it didn't work # all the time, and so is better to not bother # since Moose will handle the defaults just # fine anyway. # - SL #( exists $opt->{default} ? (default => $opt->{default}) : () ), }, ]; my $identifier = lc($opt->{name}); $identifier =~ s/\W/_/g; # Getopt::Long does this to all option names $name_to_init_arg{$identifier} = $opt->{init_arg}; } return ( \@options, \%name_to_init_arg ); } }; 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::GLD - A Moose role for processing command line options with Getopt::Long::Descriptive =head1 VERSION version 0.75 =head1 SYNOPSIS ## In your class package My::App; use Moose; with 'MooseX::Getopt::GLD'; # or with 'MooseX::Getopt::GLD' => { getopt_conf => [ 'pass_through', ... ] }; has 'out' => (is => 'rw', isa => 'Str', required => 1); has 'in' => (is => 'rw', isa => 'Str', required => 1); # ... rest of the class here ## in your script #!/usr/bin/perl use My::App; my $app = My::App->new_with_options(); # ... rest of the script here ## on the command line % perl my_app_script.pl -in file.input -out file.dump =head1 OPTIONS This role is a parameterized role. It accepts one configuration parameter, C. This parameter is an ArrayRef of strings, which are L configuration options (see "Configuring Getopt::Long" in L) =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/ProcessedArgv.pm000644 000766 000024 00000004641 14024203060 022715 0ustar00etherstaff000000 000000 package MooseX::Getopt::ProcessedArgv; # ABSTRACT: MooseX::Getopt::ProcessedArgv - Class containing the results of process_argv our $VERSION = '0.75'; use Moose; use namespace::autoclean; has 'argv_copy' => (is => 'ro', isa => 'ArrayRef'); has 'extra_argv' => (is => 'ro', isa => 'ArrayRef'); has 'usage' => (is => 'ro', isa => 'Maybe[Object]'); has 'constructor_params' => (is => 'ro', isa => 'HashRef'); has 'cli_params' => (is => 'ro', isa => 'HashRef'); __PACKAGE__->meta->make_immutable(); 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::ProcessedArgv - MooseX::Getopt::ProcessedArgv - Class containing the results of process_argv =head1 VERSION version 0.75 =head1 SYNOPSIS use My::App; my $pa = My::App->process_argv(@params); my $argv_copy = $pa->argv_copy(); my $extra_argv = $pa->extra_argv(); my $usage = $pa->usage(); my $constructor_params = $pa->constructor_params(); my $cli_params = $pa->cli_params(); =head1 DESCRIPTION This object contains the result of a L call. It contains all the information that L uses when calling new. =head1 METHODS =head2 argv_copy Reference to a copy of the original C<@ARGV> array as it originally existed at the time of C. =head2 extra_arg Arrayref of leftover C<@ARGV> elements that L did not parse. =head2 usage Contains the L object (if L is used). =head2 constructor_params Parameters passed to process_argv. =head2 cli_param Command-line parameters parsed out of C<@ARGV>. =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/Meta/Attribute/000755 000766 000024 00000000000 14024203060 022434 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/lib/MooseX/Getopt/Meta/Attribute.pm000600 000766 000024 00000006333 14024203060 022767 0ustar00etherstaff000000 000000 package MooseX::Getopt::Meta::Attribute; # ABSTRACT: Optional meta attribute for custom option names our $VERSION = '0.75'; use Moose; use namespace::autoclean; extends 'Moose::Meta::Attribute'; # << Moose extending Moose :) with 'MooseX::Getopt::Meta::Attribute::Trait'; # register this as a metaclass alias ... package # stop confusing PAUSE Moose::Meta::Attribute::Custom::Getopt; sub register_implementation { 'MooseX::Getopt::Meta::Attribute' } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::Meta::Attribute - Optional meta attribute for custom option names =head1 VERSION version 0.75 =head1 SYNOPSIS package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( metaclass => 'Getopt', is => 'ro', isa => 'Str', default => 'file.dat', # tells MooseX::Getopt to use --somedata as the # command line flag instead of the normal # autogenerated one (--data) cmd_flag => 'somedata', # tells MooseX::Getopt to also allow --moosedata, # -m, and -d as aliases for this same option on # the commandline. cmd_aliases => [qw/ moosedata m d /], # Or, you can use a plain scalar for a single alias: cmd_aliases => 'm', ); =head1 DESCRIPTION This is a custom attribute metaclass which can be used to specify a the specific command line flag to use instead of the default one which L will create for you. This is certainly not the prettiest way to go about this, but for now it works for those who might need such a feature. =head2 Use 'traits' instead of 'metaclass' You should rarely need to explicitly set the attribute metaclass. It is much preferred to simply provide a trait (a role applied to the attribute metaclass), which allows other code to further modify the attribute by applying additional roles. Therefore, you should first try to do this: has 'foo' => (traits => ['Getopt'], cmd_flag => 'f'); =head2 Custom Metaclass alias This now takes advantage of the Moose 0.19 feature to support custom attribute metaclass aliases. This means you can also use this as the B alias, like so: has 'foo' => (metaclass => 'Getopt', cmd_flag => 'f'); =head1 METHODS =head2 B Changes the command-line flag to be this value, instead of the default, which is the same as the attribute name. =head2 B Adds more aliases for this command-line flag, useful for short options and such. =head2 B =head2 B =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/Meta/Attribute/Trait.pm000600 000766 000024 00000005637 14024203060 024060 0ustar00etherstaff000000 000000 package MooseX::Getopt::Meta::Attribute::Trait; # ABSTRACT: Optional meta attribute trait for custom option names our $VERSION = '0.75'; use Moose::Role; use Moose::Util::TypeConstraints qw(subtype coerce from via as); use namespace::autoclean; has 'cmd_flag' => ( is => 'rw', isa => 'Str', predicate => 'has_cmd_flag', ); # This subtype is to support scalar -> arrayref coercion # without polluting the built-in types my $cmd_aliases = subtype as 'ArrayRef'; coerce $cmd_aliases => from 'Str' => via { [$_] }; has 'cmd_aliases' => ( is => 'rw', isa => $cmd_aliases, predicate => 'has_cmd_aliases', coerce => 1, ); # register this as a metaclass alias ... package # stop confusing PAUSE Moose::Meta::Attribute::Custom::Trait::Getopt; sub register_implementation { 'MooseX::Getopt::Meta::Attribute::Trait' } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::Meta::Attribute::Trait - Optional meta attribute trait for custom option names =head1 VERSION version 0.75 =head1 SYNOPSIS package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( traits => [ 'Getopt' ], is => 'ro', isa => 'Str', default => 'file.dat', # tells MooseX::Getopt to use --somedata as the # command line flag instead of the normal # autogenerated one (--data) cmd_flag => 'somedata', # tells MooseX::Getopt to also allow --moosedata, # -m, and -d as aliases for this same option on # the commandline. cmd_aliases => [qw/ moosedata m d /], # Or, you can use a plain scalar for a single alias: cmd_aliases => 'm', ); =head1 DESCRIPTION This is a custom attribute metaclass trait which can be used to specify a the specific command line flag to use instead of the default one which L will create for you. =head1 METHODS =head2 B Changes the command-line flag to be this value, instead of the default, which is the same as the attribute name. =head2 B Adds more aliases for this command-line flag, useful for short options and such. =head2 B =head2 B =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/Meta/Attribute/Trait/000755 000766 000024 00000000000 14024203060 023517 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm000644 000766 000024 00000005056 14024203060 024537 0ustar00etherstaff000000 000000 package MooseX::Getopt::Meta::Attribute::NoGetopt; # ABSTRACT: Optional meta attribute for ignoring parameters our $VERSION = '0.75'; use Moose; extends 'Moose::Meta::Attribute'; # << Moose extending Moose :) with 'MooseX::Getopt::Meta::Attribute::Trait::NoGetopt'; use namespace::autoclean; # register this as a metaclass alias ... package # stop confusing PAUSE Moose::Meta::Attribute::Custom::NoGetopt; sub register_implementation { 'MooseX::Getopt::Meta::Attribute::NoGetopt' } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::Meta::Attribute::NoGetopt - Optional meta attribute for ignoring parameters =head1 VERSION version 0.75 =head1 SYNOPSIS package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( metaclass => 'NoGetopt', # do not attempt to capture this param is => 'ro', isa => 'Str', default => 'file.dat', ); =head1 DESCRIPTION This is a custom attribute metaclass which can be used to specify that a specific attribute should B be processed by C. All you need to do is specify the C metaclass. has 'foo' => (metaclass => 'MooseX::Getopt::Meta::Attribute::NoGetopt', ... ); =head2 Use 'traits' instead of 'metaclass' You should rarely need to explicitly set the attribute metaclass. It is much preferred to simply provide a trait (a role applied to the attribute metaclass), which allows other code to further modify the attribute by applying additional roles. Therefore, you should first try to do this: has 'foo' => (traits => ['NoGetopt', ...], ...); =head2 Custom Metaclass alias This now takes advantage of the Moose 0.19 feature to support custom attribute metaclass. This means you can also use this as the B alias, like so: has 'foo' => (metaclass => 'NoGetopt', cmd_flag => 'f'); =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm000644 000766 000024 00000003520 14024203060 025614 0ustar00etherstaff000000 000000 package MooseX::Getopt::Meta::Attribute::Trait::NoGetopt; # ABSTRACT: Optional meta attribute trait for ignoring parameters our $VERSION = '0.75'; use Moose::Role; use namespace::autoclean; # register this as a metaclass alias ... package # stop confusing PAUSE Moose::Meta::Attribute::Custom::Trait::NoGetopt; sub register_implementation { 'MooseX::Getopt::Meta::Attribute::Trait::NoGetopt' } 1; __END__ =pod =encoding UTF-8 =head1 NAME MooseX::Getopt::Meta::Attribute::Trait::NoGetopt - Optional meta attribute trait for ignoring parameters =head1 VERSION version 0.75 =head1 SYNOPSIS package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( traits => [ 'NoGetopt' ], # do not attempt to capture this param is => 'ro', isa => 'Str', default => 'file.dat', ); =head1 DESCRIPTION This is a custom attribute metaclass trait which can be used to specify that a specific attribute should B be processed by C. All you need to do is specify the C metaclass trait. has 'foo' => (traits => [ 'NoGetopt', ... ], ... ); =head1 SUPPORT Bugs may be submitted through L (or L). There is also a mailing list available for users of this distribution, at L. There is also an irc channel available for users of this distribution, at L on C|irc://irc.perl.org/#moose>. =head1 AUTHOR Stevan Little =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2007 by Infinity Interactive, Inc. 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 MooseX-Getopt-0.75/xt/author/000755 000766 000024 00000000000 14024203060 016316 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/xt/release/000755 000766 000024 00000000000 14024203060 016434 5ustar00etherstaff000000 000000 MooseX-Getopt-0.75/xt/release/changes_has_content.t000644 000766 000024 00000002100 14024203060 022607 0ustar00etherstaff000000 000000 use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.75'; 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; } MooseX-Getopt-0.75/xt/release/cpan-changes.t000644 000766 000024 00000000344 14024203060 021151 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; MooseX-Getopt-0.75/xt/author/mojibake.t000644 000766 000024 00000000151 14024203060 020261 0ustar00etherstaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); MooseX-Getopt-0.75/xt/author/kwalitee.t000644 000766 000024 00000000275 14024203060 020314 0ustar00etherstaff000000 000000 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; MooseX-Getopt-0.75/xt/author/no-tabs.t000644 000766 000024 00000004026 14024203060 020050 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/MooseX/Getopt.pm', 'lib/MooseX/Getopt/Basic.pm', 'lib/MooseX/Getopt/Dashes.pm', 'lib/MooseX/Getopt/GLD.pm', 'lib/MooseX/Getopt/Meta/Attribute.pm', 'lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm', 'lib/MooseX/Getopt/Meta/Attribute/Trait.pm', 'lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm', 'lib/MooseX/Getopt/OptionTypeMap.pm', 'lib/MooseX/Getopt/ProcessedArgv.pm', 'lib/MooseX/Getopt/Strict.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/001_basic.t', 't/002_custom_option_type.t', 't/003_inferred_option_type.t', 't/004_nogetop.t', 't/005_strict.t', 't/006_metaclass_traits.t', 't/007_nogetopt_trait.t', 't/008_configfromfile.t', 't/009_gld_and_explicit_options.t', 't/010_dashes.t', 't/011_process_argv.t', 't/100_gld_default_bug.t', 't/101_argv_bug.t', 't/102_basic_basic.t', 't/103_uc_bug.t', 't/104_override_usage.t', 't/105_uc_bug_more.t', 't/106_no_ignore_case.t', 't/107_no_auto_help.t', 't/107_union_bug.t', 't/108_usage_attr.t', 't/109_help_flag.t', 't/110_sort_usage_by_attr_order.t', 't/111_gld_pass_through.t', 't/112_configfile_constructor_arg.t', 't/112_configfile_constructor_arg.yml', 't/113_moosex_strictconstructor.t', 't/114_init_arg.t', 't/zzz-check-breaks.t', 'xt/author/00-compile.t', 'xt/author/changes_has_content.t', 'xt/author/clean-namespaces.t', 'xt/author/distmeta.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/minimum-version.t', 'xt/author/mojibake.t', 'xt/author/no-tabs.t', 'xt/author/pod-coverage.t', 'xt/author/pod-no404s.t', 'xt/author/pod-spell.t', 'xt/author/pod-syntax.t', 'xt/author/portability.t', 'xt/release/changes_has_content.t', 'xt/release/cpan-changes.t' ); notabs_ok($_) foreach @files; done_testing; MooseX-Getopt-0.75/xt/author/changes_has_content.t000644 000766 000024 00000001044 14024203060 022477 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; plan skip_all => 'xt/release/changes_has_content.t is missing' if not -e 'xt/release/changes_has_content.t'; # skip for master branch, only for travis if (($ENV{TRAVIS_PULL_REQUEST} || '') eq 'false') { chomp(my $branch_name = ($ENV{TRAVIS_BRANCH} || `git rev-parse --abbrev-ref HEAD`)); $TODO = 'Changes need not have content for this release yet if this is only the '.$1.' branch' if ($branch_name || '') =~ /^(master|devel)$/; } do './xt/release/changes_has_content.t'; die $@ if $@; MooseX-Getopt-0.75/xt/author/minimum-version.t000644 000766 000024 00000000155 14024203060 021642 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; use Test::MinimumVersion; all_minimum_version_ok( qq{5.008003} ); MooseX-Getopt-0.75/xt/author/00-compile.t000644 000766 000024 00000003345 14024203060 020355 0ustar00etherstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More 0.94; plan tests => 12; my @module_files = ( 'MooseX/Getopt.pm', 'MooseX/Getopt/Basic.pm', 'MooseX/Getopt/Dashes.pm', 'MooseX/Getopt/GLD.pm', 'MooseX/Getopt/Meta/Attribute.pm', 'MooseX/Getopt/Meta/Attribute/NoGetopt.pm', 'MooseX/Getopt/Meta/Attribute/Trait.pm', 'MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm', 'MooseX/Getopt/OptionTypeMap.pm', 'MooseX/Getopt/ProcessedArgv.pm', 'MooseX/Getopt/Strict.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; MooseX-Getopt-0.75/xt/author/eol.t000644 000766 000024 00000004060 14024203060 017262 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/MooseX/Getopt.pm', 'lib/MooseX/Getopt/Basic.pm', 'lib/MooseX/Getopt/Dashes.pm', 'lib/MooseX/Getopt/GLD.pm', 'lib/MooseX/Getopt/Meta/Attribute.pm', 'lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm', 'lib/MooseX/Getopt/Meta/Attribute/Trait.pm', 'lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm', 'lib/MooseX/Getopt/OptionTypeMap.pm', 'lib/MooseX/Getopt/ProcessedArgv.pm', 'lib/MooseX/Getopt/Strict.pm', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/001_basic.t', 't/002_custom_option_type.t', 't/003_inferred_option_type.t', 't/004_nogetop.t', 't/005_strict.t', 't/006_metaclass_traits.t', 't/007_nogetopt_trait.t', 't/008_configfromfile.t', 't/009_gld_and_explicit_options.t', 't/010_dashes.t', 't/011_process_argv.t', 't/100_gld_default_bug.t', 't/101_argv_bug.t', 't/102_basic_basic.t', 't/103_uc_bug.t', 't/104_override_usage.t', 't/105_uc_bug_more.t', 't/106_no_ignore_case.t', 't/107_no_auto_help.t', 't/107_union_bug.t', 't/108_usage_attr.t', 't/109_help_flag.t', 't/110_sort_usage_by_attr_order.t', 't/111_gld_pass_through.t', 't/112_configfile_constructor_arg.t', 't/112_configfile_constructor_arg.yml', 't/113_moosex_strictconstructor.t', 't/114_init_arg.t', 't/zzz-check-breaks.t', 'xt/author/00-compile.t', 'xt/author/changes_has_content.t', 'xt/author/clean-namespaces.t', 'xt/author/distmeta.t', 'xt/author/eol.t', 'xt/author/kwalitee.t', 'xt/author/minimum-version.t', 'xt/author/mojibake.t', 'xt/author/no-tabs.t', 'xt/author/pod-coverage.t', 'xt/author/pod-no404s.t', 'xt/author/pod-spell.t', 'xt/author/pod-syntax.t', 'xt/author/portability.t', 'xt/release/changes_has_content.t', 'xt/release/cpan-changes.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; MooseX-Getopt-0.75/xt/author/pod-syntax.t000644 000766 000024 00000000252 14024203060 020610 0ustar00etherstaff000000 000000 #!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(); MooseX-Getopt-0.75/xt/author/portability.t000644 000766 000024 00000000267 14024203060 021052 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); MooseX-Getopt-0.75/xt/author/distmeta.t000644 000766 000024 00000000172 14024203060 020315 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); MooseX-Getopt-0.75/xt/author/pod-spell.t000644 000766 000024 00000002105 14024203060 020400 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.007005 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( examples lib script t xt ) ); __DATA__ Alders Andreas Arnfjörð Attribute Austin Basic Bjarmason Black Brandon Chris Dagfinn Damien Damyan Dashes Dave Devin Dieter Doran Drew Etheridge Fish Florian GLD Getopt Gordon Goulah Gregory Hans Hepler Hinrik Hunter Ilmari Inc Infinity Interactive Irving Ivanov Jesse John Johnson Johnston Jonathan Jose Justin Karen Koenig Kogman Krotkine König Little Luehrs Luis Mannsåker Martinez Meta Michael MooseX Nelo NoGetopt Olaf Onyiah OptionTypeMap Oschwald Pearcey Prather ProcessedArgv Ragwitz Ricardo Rolsky Ryan SIGNES Schout Shlomi Sigurðsson Stevan Strict Stuart Swartz Taylor Todd Tomas Trait Yuval andk autarch avarab blblack bobtfish chris dhoss dkrotkine dmn doy drew ether goraxe goschwald hdp hinrik ilmari irc jgoulah jlmartinez justin lib mschout nelo nothingmuch olaf rafl rjbs ryan saj_git shlomif stevan swartz thepler Ævar Örn MooseX-Getopt-0.75/xt/author/pod-no404s.t000644 000766 000024 00000000527 14024203060 020316 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More; foreach my $env_skip ( qw( SKIP_POD_NO404S AUTOMATED_TESTING ) ){ plan skip_all => "\$ENV{$env_skip} is set, skipping" if $ENV{$env_skip}; } eval "use Test::Pod::No404s"; if ( $@ ) { plan skip_all => 'Test::Pod::No404s required for testing POD'; } else { all_pod_files_ok(); } MooseX-Getopt-0.75/xt/author/clean-namespaces.t000644 000766 000024 00000000361 14024203060 021702 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CleanNamespaces 0.006 use Test::More 0.94; use Test::CleanNamespaces 0.15; subtest all_namespaces_clean => sub { all_namespaces_clean() }; done_testing; MooseX-Getopt-0.75/xt/author/pod-coverage.t000644 000766 000024 00000000334 14024203060 021056 0ustar00etherstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); MooseX-Getopt-0.75/t/004_nogetop.t000644 000766 000024 00000004230 14024203060 017046 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Fatal 0.003; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { use_ok('MooseX::Getopt'); } { package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'file.dat', cmd_flag => 'f', ); has 'cow' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'moo', cmd_aliases => [qw/ moocow m c /], ); has 'horse' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', cmd_flag => 'horsey', cmd_aliases => 'x', ); has 'length' => ( is => 'ro', isa => 'Int', default => 24 ); has 'verbose' => ( is => 'ro', isa => 'Bool', ); has 'libs' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has 'details' => ( is => 'ro', isa => 'HashRef', default => sub { {} }, ); has 'private_stuff' => ( traits => ['NoGetopt'], is => 'ro', isa => 'Int', default => 713 ); has '_private_stuff_cmdline' => ( traits => ['Getopt'], is => 'ro', isa => 'Int', default => 832, cmd_flag => 'p', ); } { local @ARGV = (); my $app = App->new_with_options; isa_ok( $app, 'App' ); ok( !$app->verbose, '... verbosity is off as expected' ); is( $app->length, 24, '... length is 24 as expected' ); is( $app->data, 'file.dat', '... data is file.dat as expected' ); is_deeply( $app->libs, [], '... libs is [] as expected' ); is_deeply( $app->details, {}, '... details is {} as expected' ); is($app->private_stuff, 713, '... private stuff is 713 as expected'); } { local @ARGV = (qw/--private_stuff 317/); like exception { App->new_with_options }, qr/Unknown option: private_stuff/; } done_testing; MooseX-Getopt-0.75/t/111_gld_pass_through.t000644 000766 000024 00000001612 14024203060 020727 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Getopt::Long::Descriptive; use_ok('MooseX::Getopt::GLD'); { package Engine::Foo; use Moose; with 'MooseX::Getopt::GLD' => { getopt_conf => [ 'pass_through' ] }; has 'foo' => ( is => 'ro', isa => 'Int', ); } { package Engine::Bar; use Moose; with 'MooseX::Getopt::GLD' => { getopt_conf => [ 'pass_through' ] };; has 'bar' => ( is => 'ro', isa => 'Int', ); } local @ARGV = ('--foo=10', '--bar=42'); { my $foo = Engine::Foo->new_with_options(); isa_ok($foo, 'Engine::Foo'); is($foo->foo, 10, '... got the right value (10)'); } { my $bar = Engine::Bar->new_with_options(); isa_ok($bar, 'Engine::Bar'); is($bar->bar, 42, '... got the right value (42)'); } done_testing; MooseX-Getopt-0.75/t/107_no_auto_help.t000644 000766 000024 00000003573 14024203060 020064 0ustar00etherstaff000000 000000 # Related information: # https://rt.cpan.org/Public/Bug/Display.html?id=47865 # https://rt.cpan.org/Public/Bug/Display.html?id=52474 # https://rt.cpan.org/Public/Bug/Display.html?id=57683 # http://www.nntp.perl.org/group/perl.moose/2010/06/msg1767.html # Summary: If we disable the "auto_help" option in Getopt::Long, then # getoptions() will not call into pod2usage() (causing program termination) # when --help is passed (and MooseX::ConfigFromFile is in use). use strict; use warnings; use Test::Needs { 'MooseX::SimpleConfig' => '0.07' }; use Test::More 0.88; use Test::Deep; use Test::Fatal 0.003; use Test::Warnings 0.009 qw(:no_end_test :all); $ENV{COLUMNS} = 80; my $fail_on_exit = 1; { package Class; use strict; use warnings; use Moose; with 'MooseX::SimpleConfig', 'MooseX::Getopt'; # this is a hacky way of being able to check that we made it past the # $opt_parser->getoptions() call in new_with_options, because it is # still going to bail out later on, on seeing the --help flag has configfile => ( is => 'ro', isa => 'Str', default => sub { $fail_on_exit = 0; 'this_value_unimportant', }, ); around print_usage_text => sub { my ($orig, $self, $usage) = @_; die $usage->text; }; no Moose; 1; } @ARGV = ('--help'); my @warnings = warnings { like( exception { Class->new_with_options }, qr/^usage: [\d\w]+.+\Q[long options...]\E\n.*--help.+Prints this usage information/ms, 'usage information looks good', ); }; cmp_deeply( \@warnings, [ re(qr/^Specified configfile \'this_value_unimportant\' does not exist, is empty, or is not readable$/) ], 'Our dummy config file doesn\'t exist', ) or diag join "\n", @warnings; ok(!$fail_on_exit, 'getoptions() lives'); had_no_warnings if $ENV{AUTHOR_TESTING}; done_testing; MooseX-Getopt-0.75/t/002_custom_option_type.t000600 000766 000024 00000002452 14024203060 021330 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Fatal; BEGIN { use_ok('MooseX::Getopt'); } { package App; use Moose; use Moose::Util::TypeConstraints; use Scalar::Util 'looks_like_number'; with 'MooseX::Getopt'; subtype 'ArrayOfInts' => as 'ArrayRef' => where { scalar (grep { looks_like_number($_) } @$_) }; MooseX::Getopt::OptionTypeMap->add_option_type_to_map( 'ArrayOfInts' => '=i@' ); has 'nums' => ( is => 'ro', isa => 'ArrayOfInts', default => sub { [0] } ); } { local @ARGV = (); my $app = App->new_with_options; isa_ok($app, 'App'); is_deeply($app->nums, [0], '... nums is [0] as expected'); } { local @ARGV = ('--nums', 3, '--nums', 5); my $app = App->new_with_options; isa_ok($app, 'App'); is_deeply($app->nums, [3, 5], '... nums is [3, 5] as expected'); } # Make sure it really used our =i@, instead of falling back # to =s@ via the type system, and test that exceptions work # while we're at it. like( exception { local @ARGV = ('--nums', 3, '--nums', 'foo'); my $app = App->new_with_options; }, qr/Value "foo" invalid/, 'Numeric constraint enforced', ); done_testing; MooseX-Getopt-0.75/t/001_basic.t000644 000766 000024 00000013727 14024203060 016464 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Moose; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { use_ok('MooseX::Getopt'); } { package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( metaclass => 'Getopt', is => 'ro', isa => 'Str', default => 'file.dat', cmd_flag => 'f', ); has 'cow' => ( metaclass => 'Getopt', is => 'ro', isa => 'Str', default => 'moo', cmd_aliases => [qw/ moocow m c /], ); has 'horse' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', cmd_flag => 'horsey', cmd_aliases => 'x', ); has 'length' => ( is => 'ro', isa => 'Int', default => 24 ); has 'verbose' => ( is => 'ro', isa => 'Bool', ); has 'libs' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has 'details' => ( is => 'ro', isa => 'HashRef', default => sub { {} }, ); has '_private_stuff' => ( is => 'ro', isa => 'Int', default => 713 ); has '_private_stuff_cmdline' => ( traits => ['Getopt'], is => 'ro', isa => 'Int', default => 832, cmd_flag => 'p', ); } foreach my $attr_name (qw(data cow horse _private_stuff_cmdline)) { my $attr = App->meta->get_attribute($attr_name); isa_ok($attr, 'Moose::Meta::Attribute'); if ($attr_name eq 'data' or $attr_name eq 'cow') { isa_ok($attr, 'MooseX::Getopt::Meta::Attribute'); } else { does_ok($attr, 'MooseX::Getopt::Meta::Attribute::Trait'); } can_ok($attr, 'cmd_flag'); can_ok($attr, 'cmd_aliases'); } { local @ARGV = (); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is off as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '--length', 50); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 50, '... length is 50 as expected'); is($app->data, 'file.dat', '... data is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '-f', 'foo.txt'); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'foo.txt', '... data is foo.txt as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '--libs', 'libs/', '--libs', 'includes/lib'); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is foo.txt as expected'); is_deeply($app->libs, ['libs/', 'includes/lib'], '... libs is [libs/, includes/lib] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--details', 'os=mac', '--details', 'name=foo'); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is foo.txt as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, { os => 'mac', name => 'foo' }, '... details is { os => mac, name => foo } as expected'); } { # Test negation on booleans too ... local @ARGV = ('--noverbose'); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is turned off as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... file is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } # Test cmd_alias without cmd_flag { local @ARGV = ('--cow', '42'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 42, 'cmd_alias, but not using it'); } { local @ARGV = ('--moocow', '88'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 88, 'cmd_alias, using long one'); } { local @ARGV = ('-c', '99'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 99, 'cmd_alias, using short one'); } # Test cmd_alias + cmd_flag { local @ARGV = ('--horsey', '123'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->horse, 123, 'cmd_alias+cmd_flag, using flag'); } { local @ARGV = ('-x', '321'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->horse, 321, 'cmd_alias+cmd_flag, using alias'); } # Test _foo + cmd_flag { local @ARGV = ('-p', '666'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->_private_stuff_cmdline, 666, '_foo + cmd_flag'); } # Test ARGV support { my @args = ('-p', 12345, '-c', 99, '-'); local @ARGV = @args; my $app = App->new_with_options; isa_ok($app, 'App'); is_deeply($app->ARGV, \@args, 'ARGV accessor'); is_deeply(\@ARGV, \@args, '@ARGV unmangled'); is_deeply($app->extra_argv, ['-'], 'extra_argv accessor'); } done_testing; MooseX-Getopt-0.75/t/100_gld_default_bug.t000644 000766 000024 00000001434 14024203060 020502 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Getopt::Long::Descriptive; use_ok('MooseX::Getopt'); { package Engine::Foo; use Moose; with 'MooseX::Getopt'; has 'nproc' => ( traits => ['Getopt'], is => 'ro', isa => 'Int', default => sub { 1 }, cmd_aliases => 'n', ); } @ARGV = (); { my $foo = Engine::Foo->new_with_options(nproc => 10); isa_ok($foo, 'Engine::Foo'); is($foo->nproc, 10, '... got the right value (10), not the default (1)'); } { my $foo = Engine::Foo->new_with_options(); isa_ok($foo, 'Engine::Foo'); is($foo->nproc, 1, '... got the right value (1), without GLD needing to handle defaults'); } done_testing; MooseX-Getopt-0.75/t/008_configfromfile.t000644 000766 000024 00000020532 14024203060 020373 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::Needs 'MooseX::ConfigFromFile'; use Test::More 0.88; use Test::Fatal; use Test::Deep '!blessed'; use Path::Tiny 0.009; use Scalar::Util 'blessed'; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; my %constructor_args; { package App; use Moose; with 'MooseX::Getopt'; with 'MooseX::ConfigFromFile'; has 'config_from_override' => ( is => 'ro', isa => 'Bool', default => 0, ); has 'optional_from_config' => ( is => 'ro', isa => 'Str', required => 0, ); has 'optional_with_init_arg' => ( is => 'ro', isa => 'Str', required => 0, init_arg => 'foo', ); has 'required_from_config' => ( is => 'ro', isa => 'Str', required => 1, ); has 'required_from_argv' => ( is => 'ro', isa => 'Str', required => 1, ); sub get_config_from_file { my ( $class, $file ) = @_; my %config = ( required_from_config => 'from_config_1', optional_from_config => 'from_config_2', ); if ( $file ne Path::Tiny::path('/notused/default') ) { $config{config_from_override} = 1; } return \%config; } around BUILDARGS => sub { my ($orig, $class) = (shift, shift); my $args = $class->$orig(@_); $constructor_args{$class} = $args; }; } { package App::DefaultConfigFile; use Moose; extends 'App'; has '+configfile' => ( default => Path::Tiny::path('/notused/default')->stringify, ); } { package App::DefaultConfigFileCodeRef; use Moose; extends 'App'; has '+configfile' => ( default => sub { return Path::Tiny::path('/notused/default')->stringify }, ); } { package App::ConfigFileWrapped; use Moose; extends 'App'; sub _get_default_configfile { '/notused/default' } } # No config specified { local @ARGV = qw( --required_from_argv 1 ); like exception { App->new_with_options }, ($Getopt::Long::Descriptive::VERSION >= 0.091 ? qr/Mandatory parameter 'required_from_config' missing/ : qr/Required option missing: required_from_config/); { my $app = App::DefaultConfigFile->new_with_options; isa_ok( $app, 'App::DefaultConfigFile' ); app_ok( $app ); ok( !$app->config_from_override, '... config_from_override false as expected' ); is( path($app->configfile), path('/notused/default'), '... configfile is /notused/default as expected' ); cmp_deeply( $constructor_args{blessed($app)}, superhashof({ configfile => str(path('/notused/default')), }), 'correct constructor args passed', ); } { my $app = App::DefaultConfigFileCodeRef->new_with_options; isa_ok( $app, 'App::DefaultConfigFileCodeRef' ); app_ok( $app ); ok( !$app->config_from_override, '... config_from_override false as expected' ); is( path($app->configfile), path('/notused/default'), '... configfile is /notused/default as expected' ); cmp_deeply( $constructor_args{blessed $app}, superhashof({ configfile => str(path('/notused/default')), }), 'correct constructor args passed', ); } SKIP: { eval "use MooseX::ConfigFromFile 0.08 (); 1;"; diag("MooseX::ConfigFromFile 0.08 needed to test this use of configfile defaults"), skip "MooseX::ConfigFromFile 0.08 needed to test this use of configfile defaults", 7 if $@; my $app = App::ConfigFileWrapped->new_with_options; isa_ok( $app, 'App::ConfigFileWrapped' ); app_ok( $app ); ok( !$app->config_from_override, '... config_from_override false as expected' ); is( $app->configfile, path('/notused/default'), '... configfile is /notused/default as expected' ); cmp_deeply( $constructor_args{blessed $app}, superhashof({ configfile => str(path('/notused/default')), }), 'correct constructor args passed', ); } } # Config specified { local @ARGV = qw( --configfile /notused/override --required_from_argv 1 --foo bar); { my $app = App->new_with_options; isa_ok( $app, 'App' ); app_ok( $app ); is( $app->optional_with_init_arg, 'bar', 'attribute set via init_arg' ); } { my $app = App::DefaultConfigFile->new_with_options; isa_ok( $app, 'App::DefaultConfigFile' ); app_ok( $app ); ok( $app->config_from_override, '... config_from_override true as expected' ); is( path($app->configfile), path('/notused/override'), '... configfile is /notused/override as expected' ); cmp_deeply( $constructor_args{blessed $app}, superhashof({ configfile => str(path('/notused/override')), }), 'correct constructor args passed', ); } { my $app = App::DefaultConfigFileCodeRef->new_with_options; isa_ok( $app, 'App::DefaultConfigFileCodeRef' ); app_ok( $app ); ok( $app->config_from_override, '... config_from_override true as expected' ); is( path($app->configfile), path('/notused/override'), '... configfile is /notused/override as expected' ); cmp_deeply( $constructor_args{blessed $app}, superhashof({ configfile => str(path('/notused/override')), }), 'correct constructor args passed', ); } { my $app = App::ConfigFileWrapped->new_with_options; isa_ok( $app, 'App::ConfigFileWrapped' ); app_ok( $app ); ok( $app->config_from_override, '... config_from_override true as expected' ); is( path($app->configfile), path('/notused/override'), '... configfile is /notused as expected' ); cmp_deeply( $constructor_args{blessed $app}, superhashof({ configfile => str(path('/notused/override')), }), 'correct constructor args passed', ); } } # Required arg not supplied from cmdline { local @ARGV = qw( --configfile /notused/override ); like exception { App->new_with_options }, ($Getopt::Long::Descriptive::VERSION >= 0.091 ? qr/Mandatory parameter 'required_from_argv' missing/ : qr/Required option missing: required_from_argv/); } # Config file value overriden from cmdline { local @ARGV = qw( --configfile /notused/override --required_from_argv 1 --required_from_config override ); my $app = App->new_with_options; isa_ok( $app, 'App' ); is( $app->required_from_config, 'override', '... required_from_config is override as expected' ); is( $app->optional_from_config, 'from_config_2', '... optional_from_config is from_config_2 as expected' ); } # No config file { local @ARGV = qw( --required_from_argv 1 --required_from_config noconfig ); my $app = App->new_with_options; isa_ok( $app, 'App' ); is( $app->required_from_config, 'noconfig', '... required_from_config is noconfig as expected' ); ok( !defined $app->optional_from_config, '... optional_from_config is undef as expected' ); } { package BaseApp::WithConfig; use Moose; with 'MooseX::ConfigFromFile'; sub get_config_from_file { return {}; } } { package DerivedApp::Getopt; use Moose; extends 'BaseApp::WithConfig'; with 'MooseX::Getopt'; } # With DerivedApp, the Getopt role was applied at a different level # than the ConfigFromFile role { ok ! exception { DerivedApp::Getopt->new_with_options }, 'Can create DerivedApp'; } sub app_ok { my $app = shift; is( $app->required_from_config, 'from_config_1', '... required_from_config is from_config_1 as expected' ); is( $app->optional_from_config, 'from_config_2', '... optional_from_config is from_config_2 as expected' ); is( $app->required_from_argv, '1', '... required_from_argv is 1 as expected' ); } done_testing; MooseX-Getopt-0.75/t/105_uc_bug_more.t000644 000766 000024 00000002036 14024203060 017665 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Moose (); use Moose::Meta::Class; use Module::Runtime 'use_module'; foreach my $role (qw/ MooseX::Getopt MooseX::Getopt::GLD MooseX::Getopt::Basic /) { use_module($role); my $meta = Moose::Meta::Class->create_anon_class( superclasses => ['Moose::Object'], ); $meta->add_attribute('debug', traits => ['Getopt'], isa => 'Bool', cmd_aliases => ['d'], is => 'ro'); $role->meta->apply($meta); ok($meta->name->new_with_options({ argv => ['-d'] })->debug, "debug was set for argv -d on $role"); { local @ARGV = ('-d'); ok($meta->name->new_with_options()->debug, "debug was set for ARGV on $role"); } ok($meta->name->new_with_options({ argv => ['--debug'] })->debug, "debug was set for argv --debug on $role"); ok($meta->name->new_with_options({ argv => ['--debug'] })->debug, "debug was set for argv --debug on $role"); } done_testing; MooseX-Getopt-0.75/t/103_uc_bug.t000644 000766 000024 00000001177 14024203060 016646 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package App; use Moose; with qw(MooseX::Getopt); has 'TrackingNumber' => ( is => 'rw', isa => 'Str', ); has 'otherparam' => ( is => 'rw', isa => 'Str', ); } { local @ARGV = ('--TrackingNumber','1Z1234567812345670','--otherparam','foo'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->TrackingNumber, '1Z1234567812345670', '... TrackingNumber is as expected'); is($app->otherparam, 'foo', '... otherparam is as expected'); } done_testing; MooseX-Getopt-0.75/t/106_no_ignore_case.t000644 000766 000024 00000003152 14024203060 020352 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Moose (); use Moose::Meta::Class; use Module::Runtime 'use_module'; foreach my $role (qw/ MooseX::Getopt MooseX::Getopt::GLD MooseX::Getopt::Basic /) { use_module($role); my $meta = Moose::Meta::Class->create_anon_class( superclasses => ['Moose::Object'], ); $meta->add_attribute('BigD', traits => ['Getopt'], isa => 'Bool', cmd_aliases => ['D'], is => 'ro'); $meta->add_attribute('SmallD', traits => ['Getopt'], isa => 'Bool', cmd_aliases => ['d'], is => 'ro'); $role->meta->apply($meta); { my $obj = $meta->name->new_with_options( { argv => ["-d"], no_ignore_case => 1} ); ok((! $obj->BigD), "BigD was not set for argv -d on $role"); ok($obj->SmallD, "SmallD was set for argv -d on $role"); } ok($meta->name->new_with_options({ argv => ['-d'], no_ignore_case => 1}) ->SmallD, "SmallD was set for argv -d on $role"); { local @ARGV = ('-d'); ok($meta->name->new_with_options()->SmallD, "SmallD was set for ARGV on $role"); } ok($meta->name->new_with_options({ argv => ['-D'], no_ignore_case => 1}) ->BigD, "BigD was set for argv -d on $role"); { my $obj = $meta->name->new_with_options( { argv => ['-D', "-d"], no_ignore_case => 1} ); ok($obj->BigD, "BigD was set for argv -D -d on $role"); ok($obj->SmallD, "SmallD was set for argv -D -d on $role"); } } done_testing; MooseX-Getopt-0.75/t/007_nogetopt_trait.t000644 000766 000024 00000004222 14024203060 020441 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Fatal; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { use_ok('MooseX::Getopt'); } { package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'file.dat', cmd_flag => 'f', ); has 'cow' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'moo', cmd_aliases => [qw/ moocow m c /], ); has 'horse' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', cmd_flag => 'horsey', cmd_aliases => 'x', ); has 'length' => ( is => 'ro', isa => 'Int', default => 24 ); has 'verbose' => ( is => 'ro', isa => 'Bool', ); has 'libs' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has 'details' => ( is => 'ro', isa => 'HashRef', default => sub { {} }, ); has 'private_stuff' => ( traits => ['NoGetopt'], is => 'ro', isa => 'Int', default => 713 ); has '_private_stuff_cmdline' => ( traits => ['Getopt'], is => 'ro', isa => 'Int', default => 832, cmd_flag => 'p', ); } { local @ARGV = (); my $app = App->new_with_options; isa_ok( $app, 'App' ); ok( !$app->verbose, '... verbosity is off as expected' ); is( $app->length, 24, '... length is 24 as expected' ); is( $app->data, 'file.dat', '... data is file.dat as expected' ); is_deeply( $app->libs, [], '... libs is [] as expected' ); is_deeply( $app->details, {}, '... details is {} as expected' ); is($app->private_stuff, 713, '... private stuff is 713 as expected'); } { local @ARGV = (qw/--private_stuff 317/); like exception { App->new_with_options }, qr/Unknown option: private_stuff/; } done_testing; MooseX-Getopt-0.75/t/112_configfile_constructor_arg.t000600 000766 000024 00000002035 14024203060 022767 0ustar00etherstaff000000 000000 use strict; use warnings; # respect the configfile value passed into the constructor. use Test::Needs 'MooseX::SimpleConfig', 'YAML'; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Path::Tiny 0.009; { package Foo; use Moose; with 'MooseX::Getopt', 'MooseX::SimpleConfig'; has foo => ( is => 'ro', isa => 'Str', default => 'foo default', ); has _somename => ( is => 'ro', isa => 'Str', required => 1, init_arg => 'somename' ); } { my $configfile = path(qw(t 112_configfile_constructor_arg.yml))->stringify; my $obj = Foo->new_with_options(configfile => $configfile); is( path($obj->configfile), $configfile, 'configfile value is used from the constructor', ); is( $obj->foo, 'foo value', 'value is read in from the config file', ); is( $obj->_somename, "franz", 'public value is read in from the config file and goes through init_arg to private attribute', ); } done_testing; MooseX-Getopt-0.75/t/113_moosex_strictconstructor.t000644 000766 000024 00000002201 14024203060 022600 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::Needs 'MooseX::StrictConstructor'; use Test::More 0.88; use Test::Fatal; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package Test1; use Moose; with 'MooseX::Getopt'; use MooseX::StrictConstructor; has att1 => (is => 'ro', isa => 'Str'); }; { my $o1; is( exception { $o1 = Test1->new_with_options(argv => [ '--att1', 'value1' ]); }, undef, 'new_with_options + argv on a MooseX::StrictConstructor enabled class', ); cmp_ok($o1->att1, 'eq', 'value1', 'att1 gets initialized correctly'); } { package Test2; use Moose; with 'MooseX::Getopt'; use MooseX::StrictConstructor; has argv => (is => 'ro'); has att1 => (is => 'ro', isa => 'Str'); }; { my $o2; is( exception { $o2 = Test2->new_with_options(argv => [ '--att1', 'value1' ]); }, undef, 'new_with_options + argv on a MooseX::StrictConstructor enabled class', ); cmp_ok($o2->att1, 'eq', 'value1', 'att1 gets initialized correctly'); is_deeply($o2->argv, ['--att1', 'value1'], 'attribute argv is correct too'); } done_testing; MooseX-Getopt-0.75/t/114_init_arg.t000600 000766 000024 00000002203 14024203060 017157 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package Test1; use Moose; with 'MooseX::Getopt'; has _private => ( is => 'ro', isa => 'Str', init_arg => 'public' ); has name_after => ( is => 'ro', isa => 'Str', init_arg => 'name_before' ); has bar => ( is => 'ro', isa => 'Str', ); has undefined_init_arg => ( is => 'ro', isa => 'Str', init_arg => undef ); }; { my $obj = Test1->new_with_options( argv => [ '--name_before', 'something', '--bar', 'baz', '--public', 1 ] ); is( $obj->name_after, 'something', 'init_arg is respected' ); is( $obj->_private, 1, 'works with "public" init_arg and private attribute'); } { package Test::Dashes; use Moose; with 'MooseX::Getopt::Dashes'; has name_after => ( is => 'ro', isa => 'Str', init_arg => 'name-before' ); has bar => ( is => 'ro', isa => 'Str', ); }; { my $obj = Test::Dashes->new_with_options( argv => [ '--name-before', 'something', '--bar', 'baz', ] ); is( $obj->name_after, 'something', 'init_arg is respected with dashes' ); } done_testing; MooseX-Getopt-0.75/t/110_sort_usage_by_attr_order.t000644 000766 000024 00000002441 14024203060 022465 0ustar00etherstaff000000 000000 # The usage information prints the 'documentation' value for all Getopt # attributes, except the order is not deterministic (rather, it uses the order # in which the attributes are stored in the metaclass 'attributes' hash). # Let's sort them by insertion order, which should lead to nicer output: # If MooseX::Getopt is applied early, the help options will be on top # the help options will always be on top (assuming this role is applied # early), followed by options added by parent classes and roles, and then # options added by this class. use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; $ENV{COLUMNS} = 80; { package MyClass; use strict; use warnings; use Moose; with 'MooseX::Getopt'; has $_ => ( is => 'ro', isa => 'Str', traits => ['Getopt'], documentation => 'Documentation for "' . $_ . '"', ) foreach qw(foo bar baz); } my $obj = MyClass->new_with_options(); like( $obj->usage->text, qr/\A\Qusage: 110_sort_usage_by_attr_order.t [-?h] [long options...]\E \t.*--help.+Prints this usage information\..* \t--foo (STR)?\s+Documentation for "foo" \t--bar (STR)?\s+Documentation for "bar" \t--baz (STR)?\s+Documentation for "baz"\Z/ms, 'Usage text has nicely sorted options', ); done_testing; MooseX-Getopt-0.75/t/109_help_flag.t000644 000766 000024 00000003623 14024203060 017327 0ustar00etherstaff000000 000000 # The documentation claims: # If Getopt::Long::Descriptive is installed and any of the following command # line params are passed (--help, --usage, --?), the program will exit with # usage information... # This is not actually true (as of 0.29), as: # 1. the consuming class must set up a attributes named 'help', 'usage' and # '?' to contain these command line options, which is not clearly # documented as a requirement # 2. the code is checking whether an option was parsed into an attribute # *called* 'help', 'usage' or '?', not whether the option --help, --usage # or --? was passed on the command-line (the mapping could be different, # if cmd_flag or cmd_aliases is used), # This inconsistency is the underlying cause of RT#52474, RT#57683, RT#47865. # Update: since 0.41, usage info is printed to stdout, not stderr. use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Trap; { package MyClass; use strict; use warnings; use Moose; with 'MooseX::Getopt'; } # before fix, prints this on stderr: #Unknown option: ? #usage: test1.t # after fix, prints this on stdout (formerly stderr): #usage: test1.t [-?] [long options...] # -? --usage --help Prints this usage information. my $obj = MyClass->new_with_options; ok($obj->meta->has_attribute('usage'), 'class has usage attribute'); isa_ok($obj->usage, 'Getopt::Long::Descriptive::Usage'); my $usage_text = $obj->usage->text; foreach my $args ( ['--help'], ['--usage'], ['--?'], ['-?'], ['-h'] ) { local @ARGV = @$args; note "Setting \@ARGV to @$args"; trap { MyClass->new_with_options() }; is($trap->leaveby, 'exit', 'bailed with an exit code'); is($trap->exit, 0, '...of 0'); is( $trap->stdout, $usage_text, 'Usage information printed to STDOUT', ); is($trap->stderr, '', 'there was no STDERR output'); } done_testing; MooseX-Getopt-0.75/t/006_metaclass_traits.t000644 000766 000024 00000013560 14024203060 020745 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Moose; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { use_ok('MooseX::Getopt'); } { package App; use Moose; with 'MooseX::Getopt'; has 'data' => ( traits => [ 'MooseX::Getopt::Meta::Attribute::Trait' ], is => 'ro', isa => 'Str', default => 'file.dat', cmd_flag => 'f', ); has 'cow' => ( traits => [ 'Getopt' ], is => 'ro', isa => 'Str', default => 'moo', cmd_aliases => [qw/ moocow m c /], ); has 'horse' => ( traits => [ 'Getopt' ], is => 'ro', isa => 'Str', default => 'bray', cmd_flag => 'horsey', cmd_aliases => 'x', ); has 'length' => ( is => 'ro', isa => 'Int', default => 24 ); has 'verbose' => ( is => 'ro', isa => 'Bool', ); has 'libs' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has 'details' => ( is => 'ro', isa => 'HashRef', default => sub { {} }, ); has '_private_stuff' => ( is => 'ro', isa => 'Int', default => 713 ); has '_private_stuff_cmdline' => ( traits => [ 'Getopt' ], is => 'ro', isa => 'Int', default => 832, cmd_flag => 'p', ); } foreach my $attr_name (qw(data cow horse _private_stuff_cmdline)) { my $attr = App->meta->get_attribute($attr_name); isa_ok($attr, 'Moose::Meta::Attribute'); does_ok($attr, 'MooseX::Getopt::Meta::Attribute::Trait'); can_ok($attr, 'cmd_flag'); can_ok($attr, 'cmd_aliases'); } { local @ARGV = (); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is off as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '--length', 50); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 50, '... length is 50 as expected'); is($app->data, 'file.dat', '... data is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '-f', 'foo.txt'); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'foo.txt', '... data is foo.txt as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '--libs', 'libs/', '--libs', 'includes/lib'); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is foo.txt as expected'); is_deeply($app->libs, ['libs/', 'includes/lib'], '... libs is [libs/, includes/lib] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--details', 'os=mac', '--details', 'name=foo'); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is foo.txt as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, { os => 'mac', name => 'foo' }, '... details is { os => mac, name => foo } as expected'); } { # Test negation on booleans too ... local @ARGV = ('--noverbose'); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is turned off as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... file is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } # Test cmd_alias without cmd_flag { local @ARGV = ('--cow', '42'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 42, 'cmd_alias, but not using it'); } { local @ARGV = ('--moocow', '88'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 88, 'cmd_alias, using long one'); } { local @ARGV = ('-c', '99'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 99, 'cmd_alias, using short one'); } # Test cmd_alias + cmd_flag { local @ARGV = ('--horsey', '123'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->horse, 123, 'cmd_alias+cmd_flag, using flag'); } { local @ARGV = ('-x', '321'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->horse, 321, 'cmd_alias+cmd_flag, using alias'); } # Test _foo + cmd_flag { local @ARGV = ('-p', '666'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->_private_stuff_cmdline, 666, '_foo + cmd_flag'); } # Test ARGV support { my @args = ('-p', 12345, '-c', 99, '-'); local @ARGV = @args; my $app = App->new_with_options; isa_ok($app, 'App'); is_deeply($app->ARGV, \@args, 'ARGV accessor'); is_deeply(\@ARGV, \@args, '@ARGV unmangled'); is_deeply($app->extra_argv, ['-'], 'extra_argv accessor'); } done_testing; MooseX-Getopt-0.75/t/101_argv_bug.t000644 000766 000024 00000001211 14024203060 017161 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use MooseX::Getopt; { package App; use Moose; with 'MooseX::Getopt'; has 'length' => ( is => 'ro', isa => 'Int', default => 24, ); has 'verbose' => ( is => 'ro', isa => 'Bool', default => 0, ); no Moose; } { my $app = App->new_with_options(argv => [ '--verbose', '--length', 50 ]); isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 50, '... length is 50 as expected'); } done_testing; MooseX-Getopt-0.75/t/009_gld_and_explicit_options.t000644 000766 000024 00000001324 14024203060 022445 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Fatal; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Getopt::Long::Descriptive; use_ok('MooseX::Getopt'); { package Testing::Foo; use Moose; with 'MooseX::Getopt'; has 'bar' => ( is => 'ro', isa => 'Int', required => 1, ); has 'baz' => ( is => 'ro', isa => 'Int', required => 1, ); } @ARGV = qw(--bar 10); my $foo; ok ! exception { $foo = Testing::Foo->new_with_options(baz => 100); }, '... this should work'; isa_ok($foo, 'Testing::Foo'); is($foo->bar, 10, '... got the right values'); is($foo->baz, 100, '... got the right values'); done_testing; MooseX-Getopt-0.75/t/005_strict.t000644 000766 000024 00000004064 14024203060 016711 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Fatal; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { use_ok('MooseX::Getopt'); } { package App; use Moose; with 'MooseX::Getopt::Strict'; has 'data' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'file.dat', cmd_flag => 'f', ); has 'cow' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'moo', cmd_aliases => [qw/ moocow m c /], ); has 'horse' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', cmd_flag => 'horsey', cmd_aliases => 'x', ); has 'length' => ( is => 'ro', isa => 'Int', default => 24 ); has 'verbose' => ( is => 'ro', isa => 'Bool', ); has 'libs' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has 'details' => ( is => 'ro', isa => 'HashRef', default => sub { {} }, ); has 'private_stuff' => ( is => 'ro', isa => 'Int', default => 713 ); } { local @ARGV = (); my $app = App->new_with_options; isa_ok( $app, 'App' ); ok( !$app->verbose, '... verbosity is off as expected' ); is( $app->length, 24, '... length is 24 as expected' ); is( $app->data, 'file.dat', '... data is file.dat as expected' ); is_deeply( $app->libs, [], '... libs is [] as expected' ); is_deeply( $app->details, {}, '... details is {} as expected' ); is($app->private_stuff, 713, '... private stuff is 713 as expected'); } { local @ARGV = (qw/--private_stuff 317/); like exception { App->new_with_options }, qr/Unknown option: private_stuff/; } { local @ARGV = (qw/--length 100/); like exception { App->new_with_options }, qr/Unknown option: length/; } done_testing; MooseX-Getopt-0.75/t/011_process_argv.t000644 000766 000024 00000001617 14024203060 020074 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Fatal 0.003; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package Testing::Foo; use Moose; with 'MooseX::Getopt'; has 'bar' => ( is => 'ro', isa => 'Int', required => 1, ); has 'baz' => ( is => 'ro', isa => 'Int', required => 1, ); } @ARGV = qw(--bar 10 file.dat); my $pa; is( exception { $pa = Testing::Foo->process_argv(baz => 100); }, undef, '... this should work' ); isa_ok($pa, 'MooseX::Getopt::ProcessedArgv'); is_deeply($pa->argv_copy, [ '--bar', '10', 'file.dat' ], 'argv_copy'); is_deeply($pa->cli_params, { 'bar' => 10 }, 'cli_params'); is_deeply($pa->constructor_params, { 'baz' => 100 }, 'constructor_params'); is_deeply($pa->extra_argv, [ 'file.dat' ], 'extra_argv'); done_testing; MooseX-Getopt-0.75/t/108_usage_attr.t000644 000766 000024 00000001713 14024203060 017541 0ustar00etherstaff000000 000000 # Re RT#58715 and the claim in the documentation: # If you have Getopt::Long::Descriptive the usage param is also passed to new. # This tests the fix (that fulfills the documentation claim). use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package MyClass; use strict; use warnings; use Moose; with 'MooseX::Getopt'; } Moose::Meta::Class->create('MyClassWithBasic', superclasses => ['MyClass'], roles => [ 'MooseX::Getopt::Basic' ], ); my $basic_obj = MyClassWithBasic->new_with_options(); ok(!$basic_obj->meta->has_attribute('usage'), 'basic class has no usage attribute'); Moose::Meta::Class->create('MyClassWithGLD', superclasses => ['MyClass'], roles => [ 'MooseX::Getopt' ], ); my $gld_obj = MyClassWithGLD->new_with_options(); ok($gld_obj->meta->has_attribute('usage'), 'class has usage attribute'); isa_ok($gld_obj->usage, 'Getopt::Long::Descriptive::Usage'); done_testing; MooseX-Getopt-0.75/t/00-report-prereqs.t000644 000766 000024 00000013664 14024203060 020232 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.028 use Test::More tests => 1; use Module::Metadata; 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( Encode File::Temp JSON::PP Module::Runtime Pod::Coverage Sub::Name YAML autodie Dist::CheckConflicts ); 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 $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = Module::Metadata->new_from_file( File::Spec->catfile($prefix, $file) )->version; $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: MooseX-Getopt-0.75/t/102_basic_basic.t000644 000766 000024 00000013527 14024203060 017625 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Moose; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { use_ok('MooseX::Getopt::Basic'); } { package App; use Moose; with 'MooseX::Getopt::Basic'; has 'data' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'file.dat', cmd_flag => 'f', ); has 'cow' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'moo', cmd_aliases => [qw/ moocow m c /], ); has 'horse' => ( traits => ['Getopt'], is => 'ro', isa => 'Str', default => 'bray', cmd_flag => 'horsey', cmd_aliases => 'x', ); has 'length' => ( is => 'ro', isa => 'Int', default => 24 ); has 'verbose' => ( is => 'ro', isa => 'Bool', ); has 'libs' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] }, ); has 'details' => ( is => 'ro', isa => 'HashRef', default => sub { {} }, ); has '_private_stuff' => ( is => 'ro', isa => 'Int', default => 713 ); has '_private_stuff_cmdline' => ( traits => ['Getopt'], is => 'ro', isa => 'Int', default => 832, cmd_flag => 'p', ); } foreach my $attr_name (qw(data cow horse _private_stuff_cmdline)) { my $attr = App->meta->get_attribute($attr_name); isa_ok($attr, 'Moose::Meta::Attribute'); does_ok($attr, 'MooseX::Getopt::Meta::Attribute::Trait'); can_ok($attr, 'cmd_flag'); can_ok($attr, 'cmd_aliases'); } { local @ARGV = (); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is off as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '--length', 50); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 50, '... length is 50 as expected'); is($app->data, 'file.dat', '... data is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '-f', 'foo.txt'); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'foo.txt', '... data is foo.txt as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--verbose', '--libs', 'libs/', '--libs', 'includes/lib'); my $app = App->new_with_options; isa_ok($app, 'App'); ok($app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is foo.txt as expected'); is_deeply($app->libs, ['libs/', 'includes/lib'], '... libs is [libs/, includes/lib] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } { local @ARGV = ('--details', 'os=mac', '--details', 'name=foo'); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is turned on as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... data is foo.txt as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, { os => 'mac', name => 'foo' }, '... details is { os => mac, name => foo } as expected'); } { # Test negation on booleans too ... local @ARGV = ('--noverbose'); my $app = App->new_with_options; isa_ok($app, 'App'); ok(!$app->verbose, '... verbosity is turned off as expected'); is($app->length, 24, '... length is 24 as expected'); is($app->data, 'file.dat', '... file is file.dat as expected'); is_deeply($app->libs, [], '... libs is [] as expected'); is_deeply($app->details, {}, '... details is {} as expected'); } # Test cmd_alias without cmd_flag { local @ARGV = ('--cow', '42'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 42, 'cmd_alias, but not using it'); } { local @ARGV = ('--moocow', '88'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 88, 'cmd_alias, using long one'); } { local @ARGV = ('-c', '99'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->cow, 99, 'cmd_alias, using short one'); } # Test cmd_alias + cmd_flag { local @ARGV = ('--horsey', '123'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->horse, 123, 'cmd_alias+cmd_flag, using flag'); } { local @ARGV = ('-x', '321'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->horse, 321, 'cmd_alias+cmd_flag, using alias'); } # Test _foo + cmd_flag { local @ARGV = ('-p', '666'); my $app = App->new_with_options; isa_ok($app, 'App'); is($app->_private_stuff_cmdline, 666, '_foo + cmd_flag'); } # Test ARGV support { my @args = ('-p', 12345, '-c', 99, '-'); local @ARGV = @args; my $app = App->new_with_options; isa_ok($app, 'App'); is_deeply($app->ARGV, \@args, 'ARGV accessor'); is_deeply(\@ARGV, \@args, '@ARGV unmangled'); is_deeply($app->extra_argv, ['-'], 'extra_argv accessor'); } done_testing; MooseX-Getopt-0.75/t/003_inferred_option_type.t000600 000766 000024 00000001551 14024203060 021614 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { use_ok('MooseX::Getopt'); } { package App; use Moose; use Moose::Util::TypeConstraints; use Scalar::Util 'looks_like_number'; with 'MooseX::Getopt'; my $array_of_ints = subtype as 'ArrayRef', where { scalar (grep { looks_like_number($_) } @$_) }; has 'nums' => ( is => 'ro', isa => $array_of_ints, default => sub { [0] } ); } { local @ARGV = (); my $app = App->new_with_options; isa_ok($app, 'App'); is_deeply($app->nums, [0], '... nums is [0] as expected'); } { local @ARGV = ('--nums', 3, '--nums', 5); my $app = App->new_with_options; isa_ok($app, 'App'); is_deeply($app->nums, [3, 5], '... nums is [3, 5] as expected'); } done_testing; MooseX-Getopt-0.75/t/00-report-prereqs.dd000644 000766 000024 00000027572 14024203060 020361 0ustar00etherstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0', 'Module::Build::Tiny' => '0.034', 'perl' => '5.006' }, 'suggests' => { 'JSON::PP' => '2.27300' } }, 'develop' => { 'recommends' => { 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.159', 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007' }, 'requires' => { 'Dist::Zilla' => '5.000', 'Encode' => '0', 'File::Spec' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'MooseX::ConfigFromFile' => '0', 'MooseX::SimpleConfig' => '0', 'MooseX::StrictConstructor' => '0', 'Pod::Coverage::TrustPod' => '0', 'Pod::Wordlist' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::CleanNamespaces' => '0.15', 'Test::EOL' => '0', 'Test::Kwalitee' => '1.21', 'Test::MinimumVersion' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.96', 'Test::NoTabs' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Pod::No404s' => '0', 'Test::Portability::Files' => '0', 'Test::Spelling' => '0.12', 'Test::Warnings' => '0', 'perl' => '5.006' } }, 'runtime' => { 'requires' => { 'Carp' => '0', 'Getopt::Long' => '2.37', 'Getopt::Long::Descriptive' => '0.088', 'Moose' => '0', 'Moose::Meta::Attribute' => '0', 'Moose::Role' => '0.56', 'Moose::Util::TypeConstraints' => '0', 'MooseX::Role::Parameterized' => '1.01', 'Scalar::Util' => '0', 'Try::Tiny' => '0', 'namespace::autoclean' => '0', 'perl' => '5.006', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900', 'MooseX::ConfigFromFile' => '0', 'MooseX::SimpleConfig' => '0' }, 'requires' => { 'File::Spec' => '0', 'Module::Metadata' => '0', 'Module::Runtime' => '0', 'Moose::Meta::Class' => '0', 'Moose::Util' => '0', 'Path::Tiny' => '0.009', 'Test::Deep' => '0', 'Test::Fatal' => '0.003', 'Test::Moose' => '0', 'Test::More' => '0.88', 'Test::Needs' => '0', 'Test::Trap' => '0', 'Test::Warnings' => '0.009', 'if' => '0', 'perl' => '5.006' }, 'suggests' => { 'MooseX::StrictConstructor' => '0' } }, 'x_Dist_Zilla' => { 'requires' => { 'Dist::Zilla' => '5', 'Dist::Zilla::Plugin::Authority' => '1.009', 'Dist::Zilla::Plugin::AutoMetaResources' => '0', 'Dist::Zilla::Plugin::AutoPrereqs' => '5.038', 'Dist::Zilla::Plugin::BumpVersionAfterRelease::Transitional' => '0.004', 'Dist::Zilla::Plugin::CheckIssues' => '0', 'Dist::Zilla::Plugin::CheckMetaResources' => '0', 'Dist::Zilla::Plugin::CheckPrereqsIndexed' => '0.019', 'Dist::Zilla::Plugin::CheckSelfDependency' => '0', 'Dist::Zilla::Plugin::CheckStrictVersion' => '0', 'Dist::Zilla::Plugin::ConfirmRelease' => '0', 'Dist::Zilla::Plugin::CopyFilesFromRelease' => '0', 'Dist::Zilla::Plugin::EnsureLatestPerl' => '0', 'Dist::Zilla::Plugin::FileFinder::ByName' => '0', 'Dist::Zilla::Plugin::GenerateFile::FromShareDir' => '0', 'Dist::Zilla::Plugin::Git::Check' => '0', 'Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch' => '0.004', 'Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts' => '0', 'Dist::Zilla::Plugin::Git::Commit' => '2.020', 'Dist::Zilla::Plugin::Git::Contributors' => '0.029', 'Dist::Zilla::Plugin::Git::Describe' => '0.004', 'Dist::Zilla::Plugin::Git::GatherDir' => '2.016', 'Dist::Zilla::Plugin::Git::Push' => '0', 'Dist::Zilla::Plugin::Git::Remote::Check' => '0', 'Dist::Zilla::Plugin::Git::Tag' => '0', 'Dist::Zilla::Plugin::GitHub::Update' => '0.40', 'Dist::Zilla::Plugin::GithubMeta' => '0.54', 'Dist::Zilla::Plugin::InstallGuide' => '1.200005', 'Dist::Zilla::Plugin::Keywords' => '0.004', 'Dist::Zilla::Plugin::License' => '5.038', 'Dist::Zilla::Plugin::MakeMaker::Fallback' => '0.029', 'Dist::Zilla::Plugin::Manifest' => '0', 'Dist::Zilla::Plugin::MetaConfig' => '0', 'Dist::Zilla::Plugin::MetaJSON' => '0', 'Dist::Zilla::Plugin::MetaNoIndex' => '0', 'Dist::Zilla::Plugin::MetaProvides::Package' => '1.15000002', 'Dist::Zilla::Plugin::MetaResources' => '0', 'Dist::Zilla::Plugin::MetaTests' => '0', 'Dist::Zilla::Plugin::MetaYAML' => '0', 'Dist::Zilla::Plugin::MinimumPerl' => '1.006', 'Dist::Zilla::Plugin::ModuleBuildTiny::Fallback' => '0.018', 'Dist::Zilla::Plugin::MojibakeTests' => '0.8', 'Dist::Zilla::Plugin::NextRelease' => '5.033', 'Dist::Zilla::Plugin::PodCoverageTests' => '5.040', 'Dist::Zilla::Plugin::PodSyntaxTests' => '5.040', 'Dist::Zilla::Plugin::PodWeaver' => '4.008', 'Dist::Zilla::Plugin::Prereqs' => '0', 'Dist::Zilla::Plugin::Prereqs::AuthorDeps' => '0.006', 'Dist::Zilla::Plugin::Prereqs::Soften' => '0', 'Dist::Zilla::Plugin::PromptIfStale' => '0', 'Dist::Zilla::Plugin::Readme' => '0', 'Dist::Zilla::Plugin::ReadmeAnyFromPod' => '0.142180', 'Dist::Zilla::Plugin::RewriteVersion::Transitional' => '0.006', 'Dist::Zilla::Plugin::Run::AfterBuild' => '0.041', 'Dist::Zilla::Plugin::Run::AfterRelease' => '0.038', 'Dist::Zilla::Plugin::RunExtraTests' => '0.024', 'Dist::Zilla::Plugin::StaticInstall' => '0.005', 'Dist::Zilla::Plugin::Test::CPAN::Changes' => '0.012', 'Dist::Zilla::Plugin::Test::ChangesHasContent' => '0', 'Dist::Zilla::Plugin::Test::CheckBreaks' => '0.017', 'Dist::Zilla::Plugin::Test::CleanNamespaces' => '0.006', 'Dist::Zilla::Plugin::Test::Compile' => '2.039', 'Dist::Zilla::Plugin::Test::EOL' => '0.17', 'Dist::Zilla::Plugin::Test::Kwalitee' => '2.10', 'Dist::Zilla::Plugin::Test::MinimumVersion' => '2.000010', 'Dist::Zilla::Plugin::Test::NoTabs' => '0.08', 'Dist::Zilla::Plugin::Test::Pod::No404s' => '1.003', 'Dist::Zilla::Plugin::Test::PodSpelling' => '2.006003', 'Dist::Zilla::Plugin::Test::Portability' => '2.000007', 'Dist::Zilla::Plugin::Test::ReportPrereqs' => '0.022', 'Dist::Zilla::Plugin::TestRelease' => '0', 'Dist::Zilla::Plugin::UploadToCPAN' => '0', 'Dist::Zilla::Plugin::UseUnsafeInc' => '0', 'Dist::Zilla::PluginBundle::Author::ETHER' => '0.117', 'Dist::Zilla::PluginBundle::Git::VersionManager' => '0.007', 'Software::License::Perl_5' => '0' } } }; $x; }MooseX-Getopt-0.75/t/104_override_usage.t000700 000766 000024 00000005015 14024203060 020372 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Trap; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Moose::Util 'find_meta'; $ENV{COLUMNS} = 80; { package MyScript; use Moose; with 'MooseX::Getopt'; has foo => ( isa => 'Int', is => 'ro', documentation => 'A foo with newline and some 123456789 123456789 123456789 characters' ); } my $usage = qr/^\Qusage: 104_override_usage.t [-?h] [long options...]\E .*\t.*--help.+Prints this usage information\. .*\t--foo (INT)?\s+A foo.+characters/ms; { local @ARGV = ('--foo', '1'); my $i = trap { MyScript->new_with_options }; is($i->foo, 1, 'attr is set'); is($trap->stdout, '', 'nothing printed when option is accepted'); } { local @ARGV = ('--help'); trap { MyScript->new_with_options }; like($trap->stdout, qr/\A$usage\Z/, 'usage is printed on --help'); } { local @ARGV = ('-q'); # Does not exist trap { MyScript->new_with_options }; like($trap->die, qr/\AUnknown option: q\n$usage\Z/, 'usage is printed on unknown option'); } { find_meta('MyScript')->add_before_method_modifier( print_usage_text => sub { print "--- DOCUMENTATION ---\n"; }, ); local @ARGV = ('--help'); trap { MyScript->new_with_options }; like( $trap->stdout, qr/^--- DOCUMENTATION ---\n$usage\Z/, 'additional text included before normal usage string', ); } { find_meta('MyScript')->add_after_method_modifier( print_usage_text => sub { print "--- DOCUMENTATION ---\n"; }, ); local @ARGV = ('--help'); trap { MyScript->new_with_options }; like( $trap->stdout, qr/$usage\n--- DOCUMENTATION ---\n/, 'additional text included before normal usage string', ); } { package MyScript2; use Moose; with 'MooseX::Getopt'; has foo => ( isa => 'Int', is => 'ro', documentation => 'A foo with newline and some 123456789 123456789 123456789 characters' ); } { # some classes (e.g. ether's darkpan and Catalyst::Runtime) overrode # _getopt_full_usage, so we need to keep it in the call stack so we don't # break them. find_meta('MyScript2')->add_before_method_modifier( _getopt_full_usage => sub { print "--- DOCUMENTATION ---\n"; }, ); local @ARGV = ('--help'); trap { MyScript2->new_with_options }; like( $trap->stdout, qr/^--- DOCUMENTATION ---\n$usage/, 'additional text included before normal usage string', ); } done_testing; MooseX-Getopt-0.75/t/zzz-check-breaks.t000644 000766 000024 00000001267 14024203060 020174 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CheckBreaks 0.019 use Test::More tests => 3; SKIP: { eval { +require Module::Runtime::Conflicts; Module::Runtime::Conflicts->check_conflicts }; skip('no Module::Runtime::Conflicts module found', 1) if not $INC{'Module/Runtime/Conflicts.pm'}; diag $@ if $@; pass 'conflicts checked via Module::Runtime::Conflicts'; } 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'; } pass 'no x_breaks data to check'; MooseX-Getopt-0.75/t/010_dashes.t000644 000766 000024 00000001755 14024203060 016650 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use Test::Fatal; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; BEGIN { use_ok('MooseX::Getopt'); } { package App; use Moose; with 'MooseX::Getopt::Dashes'; has 'some_thingy' => ( is => 'ro', isa => 'Str', default => 'foo' ); has 'another_thingy' => ( is => 'ro', isa => 'Str', default => 'foo', cmd_flag => 'another_thingy', traits => [ 'Getopt' ], ); } { local @ARGV = (qw/--some-thingy bar/); ok ! exception { is( App->new_with_options->some_thingy, 'bar') }, 'Dash in option name'; } { local @ARGV = (qw/--some_thingy bar/); like exception { App->new_with_options }, qr/Unknown option: some_thingy/; } { local @ARGV = (qw/--another_thingy bar/); ok ! exception { is( App->new_with_options->another_thingy, 'bar' ) }, 'Underscore in option name'; } { local @ARGV = (qw/--another-thingy bar/); like exception { App->new_with_options }, qr/Unknown option: another-thingy/; } done_testing; MooseX-Getopt-0.75/t/112_configfile_constructor_arg.yml000600 000766 000024 00000000051 14024203060 023321 0ustar00etherstaff000000 000000 --- foo: foo value somename: franz MooseX-Getopt-0.75/t/107_union_bug.t000600 000766 000024 00000002606 14024203060 017361 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More 0.88; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package example; use Moose; use Moose::Util::TypeConstraints; with qw( MooseX::Getopt ); subtype 'ResultSet' => as 'DBIx::Class::ResultSet'; subtype 'ResultList' => as 'ArrayRef[Int]'; MooseX::Getopt::OptionTypeMap->add_option_type_to_map( 'ResultList' => '=s', ); coerce 'ResultList' => from 'Str' => via { return [ grep { m/^\d+$/ } split /\D/,$_ ]; # <- split string into arrayref }; has 'results' => ( is => 'rw', isa => 'ResultList | ResultSet', # <- union constraint coerce => 1, ); has 'other' => ( is => 'rw', isa => 'Str', ); } # Without MooseX::Getopt { my $example = example->new({ results => '1234,5678,9012', other => 'test', }); isa_ok($example, 'example'); is_deeply($example->results, [qw(1234 5678 9012)], 'result as expected'); } # With MooseX::Getopt { local @ARGV = ('--results','1234,5678,9012','--other','test'); my $example = example->new_with_options; isa_ok($example, 'example'); is($example->other,'test'); is_deeply($example->results, [qw(1234 5678 9012)], 'result as expected'); } done_testing;