MooseX-Getopt-0.59/000755 000767 000024 00000000000 12246433065 014402 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/Build.PL000644 000767 000024 00000000066 12246433065 015700 0ustar00etherstaff000000 000000 use 5.006; use Module::Build::Tiny 0.030; Build_PL(); MooseX-Getopt-0.59/Changes000644 000767 000024 00000027535 12246433065 015711 0ustar00etherstaff000000 000000 Revision history for MooseX-Getopt 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.59/CONTRIBUTING000644 000767 000024 00000005144 12246433065 016240 0ustar00etherstaff000000 000000 CONTRIBUTING Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. The distribution is managed with 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 sufficent 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` $ 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` $ dzil listdeps --author --missing | 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 main 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. Detailed instructions for doing that is available here: https://help.github.com/ https://help.github.com/articles/creating-a-pull-request 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 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. This file was generated via Dist::Zilla::Plugin::GenerateFile::ShareDir 0.002 from a template file originating in Dist-Zilla-PluginBundle-Author-ETHER-0.041. MooseX-Getopt-0.59/dist.ini000644 000767 000024 00000001336 12246433065 016051 0ustar00etherstaff000000 000000 name = MooseX-Getopt author = Stevan Little license = Perl_5 copyright_holder = Infinity Interactive, Inc copyright_year = 2007 [@Author::ETHER] :version = 0.021 server = github Authority.authority = cpan:STEVAN AutoPrereqs.skip[0] = ^(Base)?App AutoPrereqs.skip[1] = MooseX::SimpleConfig AutoPrereqs.skip[2] = MooseX::ConfigFromFile -remove = Test::UnusedVars ; we like $class [MetaResources] x_IRC = irc://irc.perl.org/#moose x_MailingList = http://lists.perl.org/list/moose.html [Prereqs / TestRecommends] MooseX::ConfigFromFile = 0 MooseX::SimpleConfig = 0.07 [Prereqs / DevelopRequires] Test::Warnings = 0 Dist::Zilla = 5.000 ; authordep Pod::Weaver::Section::Contributors [ContributorsFromGit] MooseX-Getopt-0.59/INSTALL000644 000767 000024 00000001712 12246433065 015434 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 you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S MooseX::Getopt ## 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, then build it: % perl Build.PL % ./Build && ./Build test Then install it: % ./Build install If you are installing into a system-wide directory, you may need to run: % sudo ./Build install ## Documentation MooseX-Getopt documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc MooseX::Getopt MooseX-Getopt-0.59/lib/000755 000767 000024 00000000000 12246433065 015150 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/LICENSE000644 000767 000024 00000043722 12246433065 015417 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, Suite 500, Boston, MA 02110-1335 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.59/Makefile.PL000644 000767 000024 00000006775 12246433065 016373 0ustar00etherstaff000000 000000 # This Makefile.PL for MooseX-Getopt was generated by # Dist::Zilla::Plugin::MakeMaker::Fallback 0.004. # Don't edit it but the dist.ini used to construct it. use strict; use warnings; BEGIN { my %configure_requires = ( 'ExtUtils::MakeMaker' => '6.30', 'Module::Build::Tiny' => '0.030', ); my @missing = grep { ! eval "require $_; $_->VERSION($configure_requires{$_}); 1" } keys %configure_requires; if (not @missing) { print "Congratulations, your toolchain understands 'configure_requires'!\n\n"; } else { 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 installing manually, please retrain your fingers to run Build.PL when present instead. This public service announcement was brought to you by the Perl Toolchain Gang, the irc.perl.org #toolchain IRC channel, and the number 42. EOW sleep 10 if -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT)); } } use 5.006; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "A Moose role for processing command line options", "AUTHOR" => "Stevan Little ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30", "Module::Build::Tiny" => "0.030" }, "DISTNAME" => "MooseX-Getopt", "EXE_FILES" => [], "LICENSE" => "perl", "NAME" => "MooseX::Getopt", "PREREQ_PM" => { "Carp" => 0, "Getopt::Long" => "2.37", "Getopt::Long::Descriptive" => "0.081", "Moose" => 0, "Moose::Meta::Attribute" => 0, "Moose::Role" => "0.56", "Moose::Util::TypeConstraints" => 0, "MooseX::Role::Parameterized" => 0, "Try::Tiny" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "File::Spec::Functions" => 0, "List::Util" => 0, "Module::Runtime" => 0, "Moose::Meta::Class" => 0, "Moose::Util" => 0, "Path::Tiny" => "0.009", "Scalar::Util" => 0, "Test::Deep" => 0, "Test::Fatal" => "0.003", "Test::Moose" => 0, "Test::More" => 0, "Test::Requires" => 0, "Test::Trap" => 0, "Test::Warnings" => 0, "if" => 0 }, "VERSION" => "0.59", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; my $br = $WriteMakefileArgs{BUILD_REQUIRES}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); MooseX-Getopt-0.59/MANIFEST000644 000767 000024 00000002675 12246433065 015545 0ustar00etherstaff000000 000000 Build.PL CONTRIBUTING Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README README.md 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.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 weaver.ini xt/author/00-compile.t xt/author/pod-spell.t xt/release/changes_has_content.t xt/release/cpan-changes.t xt/release/distmeta.t xt/release/eol.t xt/release/kwalitee.t xt/release/minimum-version.t xt/release/mojibake.t xt/release/no-tabs.t xt/release/pod-coverage.t xt/release/pod-no404s.t xt/release/pod-syntax.t xt/release/portability.t xt/release/test-version.t MooseX-Getopt-0.59/META.json000644 000767 000024 00000066342 12246433065 016036 0ustar00etherstaff000000 000000 { "abstract" : "A Moose role for processing command line options", "author" : [ "Stevan Little " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.132830", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "MooseX-Getopt", "no_index" : { "directory" : [ "t", "xt", "examples" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30", "Module::Build::Tiny" : "0.030" } }, "develop" : { "recommends" : { "Dist::Zilla::PluginBundle::Author::ETHER" : "0.041" }, "requires" : { "Dist::Zilla" : "5.006", "Dist::Zilla::Plugin::ContributorsFromGit" : "0", "Dist::Zilla::Plugin::GitHub::Update" : "0", "Dist::Zilla::Plugin::GithubMeta" : "0", "Dist::Zilla::Plugin::MakeMaker::Fallback" : "0", "Dist::Zilla::Plugin::MetaResources" : "0", "Dist::Zilla::Plugin::ModuleBuildTiny" : "0.004", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::PluginBundle::Author::ETHER" : "0.021", "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", "Pod::Weaver::Section::Contributors" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::Kwalitee" : "1.12", "Test::More" : "0.94", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Warnings" : "0" } }, "runtime" : { "requires" : { "Carp" : "0", "Getopt::Long" : "2.37", "Getopt::Long::Descriptive" : "0.081", "Moose" : "0", "Moose::Meta::Attribute" : "0", "Moose::Role" : "0.56", "Moose::Util::TypeConstraints" : "0", "MooseX::Role::Parameterized" : "0", "Try::Tiny" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "0", "CPAN::Meta::Requirements" : "0", "MooseX::ConfigFromFile" : "0", "MooseX::SimpleConfig" : "0.07" }, "requires" : { "ExtUtils::MakeMaker" : "0", "File::Spec::Functions" : "0", "List::Util" : "0", "Module::Runtime" : "0", "Moose::Meta::Class" : "0", "Moose::Util" : "0", "Path::Tiny" : "0.009", "Scalar::Util" : "0", "Test::Deep" : "0", "Test::Fatal" : "0.003", "Test::Moose" : "0", "Test::More" : "0", "Test::Requires" : "0", "Test::Trap" : "0", "Test::Warnings" : "0", "if" : "0" } } }, "provides" : { "MooseX::Getopt" : { "file" : "lib/MooseX/Getopt.pm", "version" : "0.59" }, "MooseX::Getopt::Basic" : { "file" : "lib/MooseX/Getopt/Basic.pm", "version" : "0.59" }, "MooseX::Getopt::Dashes" : { "file" : "lib/MooseX/Getopt/Dashes.pm", "version" : "0.59" }, "MooseX::Getopt::GLD" : { "file" : "lib/MooseX/Getopt/GLD.pm", "version" : "0.59" }, "MooseX::Getopt::Meta::Attribute" : { "file" : "lib/MooseX/Getopt/Meta/Attribute.pm", "version" : "0.59" }, "MooseX::Getopt::Meta::Attribute::NoGetopt" : { "file" : "lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm", "version" : "0.59" }, "MooseX::Getopt::Meta::Attribute::Trait" : { "file" : "lib/MooseX/Getopt/Meta/Attribute/Trait.pm", "version" : "0.59" }, "MooseX::Getopt::Meta::Attribute::Trait::NoGetopt" : { "file" : "lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm", "version" : "0.59" }, "MooseX::Getopt::OptionTypeMap" : { "file" : "lib/MooseX/Getopt/OptionTypeMap.pm", "version" : "0.59" }, "MooseX::Getopt::ProcessedArgv" : { "file" : "lib/MooseX/Getopt/ProcessedArgv.pm", "version" : "0.59" }, "MooseX::Getopt::Strict" : { "file" : "lib/MooseX/Getopt/Strict.pm", "version" : "0.59" } }, "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.59", "x_Dist_Zilla" : { "perl" : { "version" : "5.019006" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@Author::ETHER/Git::NextVersion", "version" : "2.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", "skip" : [] } }, "name" : "@Author::ETHER/build", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : "1", "check_all_prereqs" : "1", "modules" : [], "phase" : "release", "skip" : [ "Dist::Zilla::Plugin::Git::Check", "Dist::Zilla::Plugin::Git::Commit", "Dist::Zilla::Plugin::Git::GatherDir", "Dist::Zilla::Plugin::Git::NextVersion", "Dist::Zilla::Plugin::Git::Push", "Dist::Zilla::Plugin::Git::Tag", "Dist::Zilla::Plugin::Git::Init" ] } }, "name" : "@Author::ETHER/release", "version" : "0.014" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::ETHER/ExecDir", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Author::ETHER/ShareDir", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FileFinder::ByName", "name" : "@Author::ETHER/Examples", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "name" : "@Author::ETHER/Git::GatherDir", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::ETHER/MetaYAML", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::ETHER/MetaJSON", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::ETHER/License", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::ETHER/Readme", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::ETHER/Manifest", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::GenerateFile::ShareDir", "config" : { "Dist::Zilla::Plugin::GenerateFile::ShareDir" : { "destination_filename" : "CONTRIBUTING", "dist" : "Dist-Zilla-PluginBundle-Author-ETHER", "encoding" : "UTF-8", "source_filename" : "CONTRIBUTING" } }, "name" : "@Author::ETHER/GenerateFile::ShareDir", "version" : "0.002" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "filename" : "xt/author/00-compile.t", "module_finder" : [ ":InstallModules" ], "script_finder" : [ ":ExecFiles", "@Author::ETHER/Examples" ] } }, "name" : "@Author::ETHER/Test::Compile", "version" : "2.038" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "module_finder" : [ ":InstallModules" ], "script_finder" : [ ":ExecFiles", "@Author::ETHER/Examples" ] } }, "name" : "@Author::ETHER/Test::NoTabs", "version" : "0.05" }, { "class" : "Dist::Zilla::Plugin::EOLTests", "name" : "@Author::ETHER/EOLTests", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::ETHER/MetaTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Test::Version", "name" : "@Author::ETHER/Test::Version", "version" : "0.002004" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "name" : "@Author::ETHER/Test::CPAN::Changes", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@Author::ETHER/Test::ChangesHasContent", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "name" : "@Author::ETHER/Test::MinimumVersion", "version" : "2.000005" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::ETHER/PodSyntaxTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::ETHER/PodCoverageTests", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Test::PodSpelling", "name" : "@Author::ETHER/Test::PodSpelling", "version" : "2.006001" }, { "class" : "Dist::Zilla::Plugin::Test::Pod::No404s", "name" : "@Author::ETHER/Test::Pod::No404s", "version" : "1.001" }, { "class" : "Dist::Zilla::Plugin::Test::Kwalitee", "name" : "@Author::ETHER/Test::Kwalitee", "version" : "2.07" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@Author::ETHER/MojibakeTests", "version" : "0.5" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::ETHER/Test::ReportPrereqs", "version" : "0.010" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "name" : "@Author::ETHER/Test::Portability", "version" : "2.000005" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Author::ETHER/PruneCruft", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Author::ETHER/ManifestSkip", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::ETHER/Authority", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@Author::ETHER/Git::Describe", "version" : "0.003" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@Author::ETHER/PkgVersion", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.004" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.004" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Default/SingleEncoding", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Default/Name", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Default/Version", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/prelude", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Default/Leftovers", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/postlude", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Default/Authors", "version" : "4.004" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Default/Legal", "version" : "4.004" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "-Transformer", "version" : "4.004" }, { "class" : "Pod::Weaver::Plugin::StopWords", "name" : "-StopWords", "version" : "1.008" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "Contributors", "version" : "0.006" } ] } }, "name" : "@Author::ETHER/PodWeaver", "version" : "4.002" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::ETHER/NextRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "name" : "@Author::ETHER/ReadmeAnyFromPod", "version" : "0.133290" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::ETHER/GithubMeta", "version" : "0.42" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@Author::ETHER/AutoMetaResources", "version" : "1.20" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::ETHER/MetaNoIndex", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Author::ETHER/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : {}, "Dist::Zilla::Role::MetaProvider::Provider" : { "inherit_missing" : "1", "inherit_version" : "1", "meta_noindex" : "1" } }, "name" : "@Author::ETHER/MetaProvides::Package", "version" : "1.15000001" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::ETHER/MetaConfig", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::ETHER/AutoPrereqs", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Prereqs::AuthorDeps", "name" : "@Author::ETHER/Prereqs::AuthorDeps", "version" : "0.002" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::ETHER/MinimumPerl", "version" : "1.003" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@Author::ETHER/installer_requirements", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "@Author::ETHER/pluginbundle_version", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "name" : "@Author::ETHER/RunExtraTests", "version" : "0.016" }, { "class" : "Dist::Zilla::Plugin::MakeMaker::Fallback", "name" : "@Author::ETHER/MakeMaker::Fallback", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::ModuleBuildTiny", "name" : "@Author::ETHER/ModuleBuildTiny", "version" : "0.005" }, { "class" : "Dist::Zilla::Plugin::InstallGuide", "name" : "@Author::ETHER/InstallGuide", "version" : "1.200002" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "name" : "@Author::ETHER/CheckSelfDependency", "version" : "0.005" }, { "class" : "Dist::Zilla::Plugin::Run::AfterBuild", "name" : "@Author::ETHER/Run::AfterBuild", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@Author::ETHER/initial check", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts", "name" : "@Author::ETHER/Git::CheckFor::MergeConflicts", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch", "name" : "@Author::ETHER/Git::CheckFor::CorrectBranch", "version" : "0.008" }, { "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.009" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::ETHER/TestRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@Author::ETHER/after tests", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::ETHER/UploadToCPAN", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "name" : "@Author::ETHER/CopyFilesFromRelease", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@Author::ETHER/Git::Commit", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@Author::ETHER/Git::Tag", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::GitHub::Update", "name" : "@Author::ETHER/GitHub::Update", "version" : "0.35" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "@Author::ETHER/Git::Push", "version" : "2.017" }, { "class" : "Dist::Zilla::Plugin::InstallRelease", "name" : "@Author::ETHER/InstallRelease", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::ETHER/ConfirmRelease", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "@Author::ETHER/via_options", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "MetaResources", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "recommends" } }, "name" : "TestRecommends", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "requires" } }, "name" : "DevelopRequires", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::ContributorsFromGit", "name" : "ContributorsFromGit", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "5.006" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "5.006" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "5.006" } }, "x_authority" : "cpan:STEVAN", "x_contributors" : [ "Brandon L Black ", "Chris Prather ", "Dagfinn Ilmari Manns\u00e5ker ", "Damien Krotkine ", "Devin Austin ", "Drew Taylor ", "Florian Ragwitz ", "Gordon Irving ", "Hans Dieter Pearcey ", "Hinrik \u00d6rn Sigur\u00f0sson ", "Jesse Luehrs ", "John Goulah ", "Jonathan Swartz ", "Justin Hunter ", "Karen Etheridge ", "Nelo Onyiah ", "Ricardo SIGNES ", "Ryan D Johnson ", "Shlomi Fish ", "Stevan Little ", "Todd Hepler ", "Tomas Doran ", "Yuval Kogman ", "\u00c6var Arnfj\u00f6r\u00f0 Bjarmason " ] } MooseX-Getopt-0.59/META.yml000644 000767 000024 00000042605 12246433065 015662 0ustar00etherstaff000000 000000 --- abstract: 'A Moose role for processing command line options' author: - 'Stevan Little ' build_requires: ExtUtils::MakeMaker: 0 File::Spec::Functions: 0 List::Util: 0 Module::Runtime: 0 Moose::Meta::Class: 0 Moose::Util: 0 Path::Tiny: 0.009 Scalar::Util: 0 Test::Deep: 0 Test::Fatal: 0.003 Test::Moose: 0 Test::More: 0 Test::Requires: 0 Test::Trap: 0 Test::Warnings: 0 if: 0 configure_requires: ExtUtils::MakeMaker: 6.30 Module::Build::Tiny: 0.030 dynamic_config: 0 generated_by: 'Dist::Zilla version 5.006, CPAN::Meta::Converter version 2.132830' 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 - examples provides: MooseX::Getopt: file: lib/MooseX/Getopt.pm version: 0.59 MooseX::Getopt::Basic: file: lib/MooseX/Getopt/Basic.pm version: 0.59 MooseX::Getopt::Dashes: file: lib/MooseX/Getopt/Dashes.pm version: 0.59 MooseX::Getopt::GLD: file: lib/MooseX/Getopt/GLD.pm version: 0.59 MooseX::Getopt::Meta::Attribute: file: lib/MooseX/Getopt/Meta/Attribute.pm version: 0.59 MooseX::Getopt::Meta::Attribute::NoGetopt: file: lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm version: 0.59 MooseX::Getopt::Meta::Attribute::Trait: file: lib/MooseX/Getopt/Meta/Attribute/Trait.pm version: 0.59 MooseX::Getopt::Meta::Attribute::Trait::NoGetopt: file: lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm version: 0.59 MooseX::Getopt::OptionTypeMap: file: lib/MooseX/Getopt/OptionTypeMap.pm version: 0.59 MooseX::Getopt::ProcessedArgv: file: lib/MooseX/Getopt/ProcessedArgv.pm version: 0.59 MooseX::Getopt::Strict: file: lib/MooseX/Getopt/Strict.pm version: 0.59 requires: Carp: 0 Getopt::Long: 2.37 Getopt::Long::Descriptive: 0.081 Moose: 0 Moose::Meta::Attribute: 0 Moose::Role: 0.56 Moose::Util::TypeConstraints: 0 MooseX::Role::Parameterized: 0 Try::Tiny: 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.59 x_Dist_Zilla: perl: version: 5.019006 plugins: - class: Dist::Zilla::Plugin::Git::NextVersion name: '@Author::ETHER/Git::NextVersion' version: 2.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 skip: [] name: '@Author::ETHER/build' version: 0.014 - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 1 modules: [] phase: release skip: - Dist::Zilla::Plugin::Git::Check - Dist::Zilla::Plugin::Git::Commit - Dist::Zilla::Plugin::Git::GatherDir - Dist::Zilla::Plugin::Git::NextVersion - Dist::Zilla::Plugin::Git::Push - Dist::Zilla::Plugin::Git::Tag - Dist::Zilla::Plugin::Git::Init name: '@Author::ETHER/release' version: 0.014 - class: Dist::Zilla::Plugin::ExecDir name: '@Author::ETHER/ExecDir' version: 5.006 - class: Dist::Zilla::Plugin::ShareDir name: '@Author::ETHER/ShareDir' version: 5.006 - class: Dist::Zilla::Plugin::FileFinder::ByName name: '@Author::ETHER/Examples' version: 5.006 - class: Dist::Zilla::Plugin::Git::GatherDir name: '@Author::ETHER/Git::GatherDir' version: 2.017 - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::ETHER/MetaYAML' version: 5.006 - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::ETHER/MetaJSON' version: 5.006 - class: Dist::Zilla::Plugin::License name: '@Author::ETHER/License' version: 5.006 - class: Dist::Zilla::Plugin::Readme name: '@Author::ETHER/Readme' version: 5.006 - class: Dist::Zilla::Plugin::Manifest name: '@Author::ETHER/Manifest' version: 5.006 - class: Dist::Zilla::Plugin::GenerateFile::ShareDir config: Dist::Zilla::Plugin::GenerateFile::ShareDir: destination_filename: CONTRIBUTING dist: Dist-Zilla-PluginBundle-Author-ETHER encoding: UTF-8 source_filename: CONTRIBUTING name: '@Author::ETHER/GenerateFile::ShareDir' version: 0.002 - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: filename: xt/author/00-compile.t module_finder: - ':InstallModules' script_finder: - ':ExecFiles' - '@Author::ETHER/Examples' name: '@Author::ETHER/Test::Compile' version: 2.038 - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: module_finder: - ':InstallModules' script_finder: - ':ExecFiles' - '@Author::ETHER/Examples' name: '@Author::ETHER/Test::NoTabs' version: 0.05 - class: Dist::Zilla::Plugin::EOLTests name: '@Author::ETHER/EOLTests' version: 0.02 - class: Dist::Zilla::Plugin::MetaTests name: '@Author::ETHER/MetaTests' version: 5.006 - class: Dist::Zilla::Plugin::Test::Version name: '@Author::ETHER/Test::Version' version: 0.002004 - class: Dist::Zilla::Plugin::Test::CPAN::Changes name: '@Author::ETHER/Test::CPAN::Changes' version: 0.008 - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@Author::ETHER/Test::ChangesHasContent' version: 0.006 - class: Dist::Zilla::Plugin::Test::MinimumVersion name: '@Author::ETHER/Test::MinimumVersion' version: 2.000005 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::ETHER/PodSyntaxTests' version: 5.006 - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::ETHER/PodCoverageTests' version: 5.006 - class: Dist::Zilla::Plugin::Test::PodSpelling name: '@Author::ETHER/Test::PodSpelling' version: 2.006001 - class: Dist::Zilla::Plugin::Test::Pod::No404s name: '@Author::ETHER/Test::Pod::No404s' version: 1.001 - class: Dist::Zilla::Plugin::Test::Kwalitee name: '@Author::ETHER/Test::Kwalitee' version: 2.07 - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::ETHER/MojibakeTests' version: 0.5 - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::ETHER/Test::ReportPrereqs' version: 0.010 - class: Dist::Zilla::Plugin::Test::Portability name: '@Author::ETHER/Test::Portability' version: 2.000005 - class: Dist::Zilla::Plugin::PruneCruft name: '@Author::ETHER/PruneCruft' version: 5.006 - class: Dist::Zilla::Plugin::ManifestSkip name: '@Author::ETHER/ManifestSkip' version: 5.006 - class: Dist::Zilla::Plugin::Authority name: '@Author::ETHER/Authority' version: 1.006 - class: Dist::Zilla::Plugin::Git::Describe name: '@Author::ETHER/Git::Describe' version: 0.003 - class: Dist::Zilla::Plugin::PkgVersion name: '@Author::ETHER/PkgVersion' version: 5.006 - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: 4.004 - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: 4.004 - class: Pod::Weaver::Plugin::SingleEncoding name: '@Default/SingleEncoding' version: 4.004 - class: Pod::Weaver::Section::Name name: '@Default/Name' version: 4.004 - class: Pod::Weaver::Section::Version name: '@Default/Version' version: 4.004 - class: Pod::Weaver::Section::Region name: '@Default/prelude' version: 4.004 - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: 4.004 - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: 4.004 - class: Pod::Weaver::Section::Generic name: OVERVIEW version: 4.004 - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: 4.004 - class: Pod::Weaver::Section::Collect name: METHODS version: 4.004 - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: 4.004 - class: Pod::Weaver::Section::Leftovers name: '@Default/Leftovers' version: 4.004 - class: Pod::Weaver::Section::Region name: '@Default/postlude' version: 4.004 - class: Pod::Weaver::Section::Authors name: '@Default/Authors' version: 4.004 - class: Pod::Weaver::Section::Legal name: '@Default/Legal' version: 4.004 - class: Pod::Weaver::Plugin::Transformer name: '-Transformer' version: 4.004 - class: Pod::Weaver::Plugin::StopWords name: '-StopWords' version: 1.008 - class: Pod::Weaver::Section::Contributors name: Contributors version: 0.006 name: '@Author::ETHER/PodWeaver' version: 4.002 - class: Dist::Zilla::Plugin::NextRelease name: '@Author::ETHER/NextRelease' version: 5.006 - class: Dist::Zilla::Plugin::ReadmeAnyFromPod name: '@Author::ETHER/ReadmeAnyFromPod' version: 0.133290 - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::ETHER/GithubMeta' version: 0.42 - class: Dist::Zilla::Plugin::AutoMetaResources name: '@Author::ETHER/AutoMetaResources' version: 1.20 - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::ETHER/MetaNoIndex' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: '@Author::ETHER/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: 5.006 - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: {} Dist::Zilla::Role::MetaProvider::Provider: inherit_missing: 1 inherit_version: 1 meta_noindex: 1 name: '@Author::ETHER/MetaProvides::Package' version: 1.15000001 - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::ETHER/MetaConfig' version: 5.006 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::ETHER/AutoPrereqs' version: 5.006 - class: Dist::Zilla::Plugin::Prereqs::AuthorDeps name: '@Author::ETHER/Prereqs::AuthorDeps' version: 0.002 - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::ETHER/MinimumPerl' version: 1.003 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@Author::ETHER/installer_requirements' version: 5.006 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: '@Author::ETHER/pluginbundle_version' version: 5.006 - class: Dist::Zilla::Plugin::RunExtraTests name: '@Author::ETHER/RunExtraTests' version: 0.016 - class: Dist::Zilla::Plugin::MakeMaker::Fallback name: '@Author::ETHER/MakeMaker::Fallback' version: 0.004 - class: Dist::Zilla::Plugin::ModuleBuildTiny name: '@Author::ETHER/ModuleBuildTiny' version: 0.005 - class: Dist::Zilla::Plugin::InstallGuide name: '@Author::ETHER/InstallGuide' version: 1.200002 - class: Dist::Zilla::Plugin::CheckSelfDependency name: '@Author::ETHER/CheckSelfDependency' version: 0.005 - class: Dist::Zilla::Plugin::Run::AfterBuild name: '@Author::ETHER/Run::AfterBuild' version: 0.020 - class: Dist::Zilla::Plugin::Git::Check name: '@Author::ETHER/initial check' version: 2.017 - class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts name: '@Author::ETHER/Git::CheckFor::MergeConflicts' version: 0.008 - class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch name: '@Author::ETHER/Git::CheckFor::CorrectBranch' version: 0.008 - 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.009 - class: Dist::Zilla::Plugin::TestRelease name: '@Author::ETHER/TestRelease' version: 5.006 - class: Dist::Zilla::Plugin::Git::Check name: '@Author::ETHER/after tests' version: 2.017 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::ETHER/UploadToCPAN' version: 5.006 - class: Dist::Zilla::Plugin::CopyFilesFromRelease name: '@Author::ETHER/CopyFilesFromRelease' version: 0.001 - class: Dist::Zilla::Plugin::Git::Commit name: '@Author::ETHER/Git::Commit' version: 2.017 - class: Dist::Zilla::Plugin::Git::Tag name: '@Author::ETHER/Git::Tag' version: 2.017 - class: Dist::Zilla::Plugin::GitHub::Update name: '@Author::ETHER/GitHub::Update' version: 0.35 - class: Dist::Zilla::Plugin::Git::Push name: '@Author::ETHER/Git::Push' version: 2.017 - class: Dist::Zilla::Plugin::InstallRelease name: '@Author::ETHER/InstallRelease' version: 0.008 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::ETHER/ConfirmRelease' version: 5.006 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: '@Author::ETHER/via_options' version: 5.006 - class: Dist::Zilla::Plugin::MetaResources name: MetaResources version: 5.006 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: recommends name: TestRecommends version: 5.006 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: requires name: DevelopRequires version: 5.006 - class: Dist::Zilla::Plugin::ContributorsFromGit name: ContributorsFromGit version: 0.006 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 5.006 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 5.006 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 5.006 x_authority: cpan:STEVAN x_contributors: - 'Brandon L Black ' - 'Chris Prather ' - 'Dagfinn Ilmari Mannsåker ' - 'Damien Krotkine ' - 'Devin Austin ' - 'Drew Taylor ' - 'Florian Ragwitz ' - 'Gordon Irving ' - 'Hans Dieter Pearcey ' - 'Hinrik Örn Sigurðsson ' - 'Jesse Luehrs ' - 'John Goulah ' - 'Jonathan Swartz ' - 'Justin Hunter ' - 'Karen Etheridge ' - 'Nelo Onyiah ' - 'Ricardo SIGNES ' - 'Ryan D Johnson ' - 'Shlomi Fish ' - 'Stevan Little ' - 'Todd Hepler ' - 'Tomas Doran ' - 'Yuval Kogman ' - 'Ævar Arnfjörð Bjarmason ' MooseX-Getopt-0.59/README000644 000767 000024 00000000507 12246433065 015264 0ustar00etherstaff000000 000000 This archive contains the distribution MooseX-Getopt, version 0.59: 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. MooseX-Getopt-0.59/README.md000644 000767 000024 00000025467 12246433065 015677 0ustar00etherstaff000000 000000 # NAME MooseX::Getopt - A Moose role for processing command line options # VERSION version 0.59 # 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 # DESCRIPTION This is a role which provides an alternate constructor for creating objects using parameters passed in from the command line. # METHODS ## `new_with_options (%params)` This method will take a set of default `%params` and then collect parameters from the command line (possibly overriding those in `%params`) and then return a newly constructed object. The special parameter `argv`, if specified should point to an array reference with an array to use instead of `@ARGV`. If ["GetOptions" in Getopt::Long](https://metacpan.org/pod/Getopt::Long#GetOptions) fails (due to invalid arguments), `new_with_options` will throw an exception. If [Getopt::Long::Descriptive](https://metacpan.org/pod/Getopt::Long::Descriptive) 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 __documentation__ option for each attribute to document. -? --? -h --help --usage If you have [Getopt::Long::Descriptive](https://metacpan.org/pod/Getopt::Long::Descriptive) the `usage` parameter is also passed to `new` as the usage option. ## `ARGV` This accessor contains a reference to a copy of the `@ARGV` array as it originally existed at the time of `new_with_options`. ## `extra_argv` This accessor contains an arrayref of leftover `@ARGV` elements that [Getopt::Long](https://metacpan.org/pod/Getopt::Long) did not parse. Note that the real `@ARGV` is left untouched. __Important__: By default, [Getopt::Long](https://metacpan.org/pod/Getopt::Long) will reject unrecognized _options_ (that is, options that do not correspond with attributes using the Getopt trait). To disable this, and allow options to also be saved in `extra_argv` (for example to pass along to another class's `new_with_options`), you can either enable the `pass_through` option of [Getopt::Long](https://metacpan.org/pod/Getopt::Long) for your class: `use Getopt::Long qw(:config pass_through);` or specify a value for [MooseX::Getopt::GLD](https://metacpan.org/pod/MooseX::Getopt::GLD)'s `getopt_conf` parameter. ## `usage` This accessor contains the [Getopt::Long::Descriptive::Usage](https://metacpan.org/pod/Getopt::Long::Descriptive::Usage) object (if [Getopt::Long::Descriptive](https://metacpan.org/pod/Getopt::Long::Descriptive) is used). ## `help_flag` This accessor contains the boolean state of the --help, --usage and --? options (true if any of these options were passed on the command line). ## `print_usage_text` This method is called internally when the `help_flag` state is true. It prints the text from the `usage` object (see above) to `stdout` and then the program terminates normally. You can apply a method modification (see [Moose::Manual::MethodModifiers](https://metacpan.org/pod/Moose::Manual::MethodModifiers)) if different behaviour is desired, for example to include additional text. ## `meta` This returns the role meta object. ## `process_argv (%params)` This does most of the work of `new_with_options`, analyzing the parameters and `argv`, except for actually calling the constructor. It returns a [MooseX::Getopt::ProcessedArgv](https://metacpan.org/pod/MooseX::Getopt::ProcessedArgv) object. `new_with_options` uses this method internally, so modifying this method via subclasses/roles will affect `new_with_options`. 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 Getopt::Long to handle the option accordingly. You can use the trait [MooseX::Getopt::Meta::Attribute::Trait](https://metacpan.org/pod/MooseX::Getopt::Meta::Attribute::Trait) or the attribute metaclass [MooseX::Getopt::Meta::Attribute](https://metacpan.org/pod/MooseX::Getopt::Meta::Attribute) to get non-default command-line option names and aliases. You can use the trait [MooseX::Getopt::Meta::Attribute::Trait::NoGetopt](https://metacpan.org/pod/MooseX::Getopt::Meta::Attribute::Trait::NoGetopt) or the attribute metaclass [MooseX::Getopt::Meta::Attribute::NoGetopt](https://metacpan.org/pod/MooseX::Getopt::Meta::Attribute::NoGetopt) to have `MooseX::Getopt` 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 [MooseX::Getopt::Meta::Attribute](https://metacpan.org/pod/MooseX::Getopt::Meta::Attribute). 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 Getopt will not handle a --foo parameter, but your code can still call the `foo` method. If your class also uses a configfile-loading role based on [MooseX::ConfigFromFile](https://metacpan.org/pod/MooseX::ConfigFromFile), such as [MooseX::SimpleConfig](https://metacpan.org/pod/MooseX::SimpleConfig), [MooseX::Getopt](https://metacpan.org/pod/MooseX::Getopt)'s `new_with_options` will load the configfile specified by the `--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. ## Supported Type Constraints - _Bool_ A _Bool_ type constraint is set up as a boolean option with Getopt::Long. So that this attribute description: has 'verbose' => (is => 'rw', isa => 'Bool'); would translate into `verbose!` as a Getopt::Long option descriptor, which would enable the following command line options: % my_script.pl --verbose % my_script.pl --noverbose - _Int_, _Float_, _Str_ These type constraints are set up as properly typed options with Getopt::Long, using the `=i`, `=f` and `=s` modifiers as appropriate. - _ArrayRef_ An _ArrayRef_ type constraint is set up as a multiple value option in Getopt::Long. So that this attribute description: has 'include' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); would translate into `includes=s@` as a Getopt::Long option descriptor, which would enable the following command line options: % my_script.pl --include /usr/lib --include /usr/local/lib - _HashRef_ A _HashRef_ type constraint is set up as a hash value option in Getopt::Long. So that this attribute description: has 'define' => ( is => 'rw', isa => 'HashRef', default => sub { {} } ); would translate into `define=s%` as a Getopt::Long option descriptor, which would enable the following command line options: % my_script.pl --define os=linux --define vendor=debian ## Custom Type Constraints 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 Getopt::Long validations. Better examples are certainly welcome :) ## Inferred Type Constraints If you define a custom subtype which is a subtype of one of the standard ["Supported Type Constraints"](#supported-type-constraints) above, and do not explicitly provide custom support as in ["Custom Type Constraints"](#custom-type-constraints) above, MooseX::Getopt will treat it like the parent type for Getopt purposes. For example, if you had the same custom `ArrayOfInts` subtype from the examples above, but did not add a new custom option type for it to the `OptionTypeMap`, it would be treated just like a normal `ArrayRef` type for Getopt purposes (that is, `=s@`). ## More Customization Options See ["Configuring Getopt::Long" in Getopt::Long](https://metacpan.org/pod/Getopt::Long#Configuring-Getopt::Long) for many other customizations you can make to how options are parsed. Simply `use Getopt::Long qw(:config other_options...)` in your class to set these. # SEE ALSO [MooseX::Getopt::Usage](https://metacpan.org/pod/MooseX::Getopt::Usage), an extension to generate man pages, with colour # AUTHOR Stevan Little # 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. # CONTRIBUTORS - Brandon L Black - Chris Prather - Dagfinn Ilmari Mannsåker - Damien Krotkine - Devin Austin - Drew Taylor - Florian Ragwitz - Gordon Irving - Hans Dieter Pearcey - Hinrik Örn Sigurðsson - Jesse Luehrs - John Goulah - Jonathan Swartz - Justin Hunter - Karen Etheridge - Nelo Onyiah - Ricardo SIGNES - Ryan D Johnson - Shlomi Fish - Stevan Little - Todd Hepler - Tomas Doran - Yuval Kogman - Ævar Arnfjörð Bjarmason MooseX-Getopt-0.59/t/000755 000767 000024 00000000000 12246433065 014645 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/weaver.ini000644 000767 000024 00000000114 12246433065 016370 0ustar00etherstaff000000 000000 [@Default] [-Transformer] transformer = List [-StopWords] [Contributors] MooseX-Getopt-0.59/xt/000755 000767 000024 00000000000 12246433065 015035 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/xt/author/000755 000767 000024 00000000000 12246433065 016337 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/xt/release/000755 000767 000024 00000000000 12246433065 016455 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/xt/release/changes_has_content.t000644 000767 000024 00000002010 12246433065 022630 0ustar00etherstaff000000 000000 #!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.59'; my $trial_token = '-TRIAL'; 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; # _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit # by Jerome Quelin 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>); 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.59/xt/release/cpan-changes.t000644 000767 000024 00000000263 12246433065 021172 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; use Test::More 0.96 tests => 2; use_ok('Test::CPAN::Changes'); subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; done_testing(); MooseX-Getopt-0.59/xt/release/distmeta.t000644 000767 000024 00000000217 12246433065 020454 0ustar00etherstaff000000 000000 #!perl use Test::More; eval "use Test::CPAN::Meta"; plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; meta_yaml_ok(); MooseX-Getopt-0.59/xt/release/eol.t000644 000767 000024 00000000240 12246433065 017415 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; eval 'use Test::EOL'; plan skip_all => 'Test::EOL required' if $@; all_perl_files_ok({ trailing_whitespace => 1 }); MooseX-Getopt-0.59/xt/release/kwalitee.t000644 000767 000024 00000000166 12246433065 020452 0ustar00etherstaff000000 000000 # this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.07 use strict; use warnings; use Test::Kwalitee; MooseX-Getopt-0.59/xt/release/minimum-version.t000644 000767 000024 00000000271 12246433065 022000 0ustar00etherstaff000000 000000 #!perl use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.008001} ); MooseX-Getopt-0.59/xt/release/mojibake.t000644 000767 000024 00000000406 12246433065 020423 0ustar00etherstaff000000 000000 #!perl use strict; use warnings qw(all); use Test::More; ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval) eval q(use Test::Mojibake); plan skip_all => q(Test::Mojibake required for source encoding testing) if $@; all_files_encoding_ok(); MooseX-Getopt-0.59/xt/release/no-tabs.t000644 000767 000024 00000001211 12246433065 020200 0ustar00etherstaff000000 000000 use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.05 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' ); notabs_ok($_) foreach @files; done_testing; MooseX-Getopt-0.59/xt/release/pod-coverage.t000644 000767 000024 00000000527 12246433065 021221 0ustar00etherstaff000000 000000 #!perl use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); MooseX-Getopt-0.59/xt/release/pod-no404s.t000644 000767 000024 00000000527 12246433065 020455 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.59/xt/release/pod-syntax.t000644 000767 000024 00000000212 12246433065 020743 0ustar00etherstaff000000 000000 #!perl use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); MooseX-Getopt-0.59/xt/release/portability.t000644 000767 000024 00000000276 12246433065 021211 0ustar00etherstaff000000 000000 #!perl 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.59/xt/release/test-version.t000644 000767 000024 00000000643 12246433065 021307 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 0.002004 BEGIN { eval "use Test::Version; 1;" or die $@; } my @imports = ( 'version_all_ok' ); my $params = { is_strict => 1, has_version => 1, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; MooseX-Getopt-0.59/xt/author/00-compile.t000644 000767 000024 00000002622 12246433065 020373 0ustar00etherstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.038 use Test::More 0.94 tests => 11 + ($ENV{AUTHOR_TESTING} ? 1 : 0); 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 $inc_switch = -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 $stderr = IO::Handle->new; binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @warnings; for my $lib (@module_files) { # see L my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; BAIL_OUT("Compilation problems") if !Test::More->builder->is_passing; MooseX-Getopt-0.59/xt/author/pod-spell.t000644 000767 000024 00000001567 12246433065 020434 0ustar00etherstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006001 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ Stevan Little stevan Infinity Interactive Inc Brandon Black blblack Chris Prather chris Dagfinn Ilmari Mannsåker ilmari Damien Krotkine dkrotkine Devin Austin devin Drew Taylor drew Florian Ragwitz rafl Gordon Irving goraxe Hans Dieter Pearcey hdp Hinrik Örn Sigurðsson hinrik Jesse Luehrs doy John Goulah jgoulah Jonathan Swartz swartz Justin Hunter justin Karen Etheridge ether Nelo Onyiah nelo Ricardo SIGNES rjbs Ryan Johnson ryan Shlomi Fish shlomif Todd Hepler thepler Tomas Doran bobtfish Yuval Kogman nothingmuch Ævar Arnfjörð Bjarmason avarab lib MooseX Getopt Meta Attribute NoGetopt Trait OptionTypeMap Dashes Basic ProcessedArgv Strict GLD MooseX-Getopt-0.59/t/00-report-prereqs.t000644 000767 000024 00000007406 12246433065 020250 0ustar00etherstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.010 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec::Functions; use List::Util qw/max/; my @modules = qw( CPAN::Meta CPAN::Meta::Requirements Carp ExtUtils::MakeMaker File::Spec::Functions Getopt::Long Getopt::Long::Descriptive List::Util Module::Build::Tiny Module::Runtime Moose Moose::Meta::Attribute Moose::Meta::Class Moose::Role Moose::Util Moose::Util::TypeConstraints MooseX::ConfigFromFile MooseX::Role::Parameterized MooseX::SimpleConfig Path::Tiny Scalar::Util Test::Deep Test::Fatal Test::Moose Test::More Test::Requires Test::Trap Test::Warnings Try::Tiny if perl strict warnings ); my %exclude = map {; $_ => 1 } qw( ); my ($source) = grep { -f $_ } qw/MYMETA.json MYMETA.yml META.json/; $source = "META.yml" unless defined $source; # replace modules with dynamic results from MYMETA.json if we can # (hide CPAN::Meta from prereq scanner) my $cpan_meta = "CPAN::Meta"; my $cpan_meta_req = "CPAN::Meta::Requirements"; my $all_requires; if ( -f $source && eval "require $cpan_meta" ) { ## no critic if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { # Get ALL modules mentioned in META (any phase/type) my $prereqs = $meta->prereqs; delete $prereqs->{develop} if not $ENV{AUTHOR_TESTING}; my %uniq = map {$_ => 1} map { keys %$_ } map { values %$_ } values %$prereqs; $uniq{$_} = 1 for @modules; # don't lose any static ones @modules = sort grep { ! $exclude{$_} } keys %uniq; # If verifying, merge 'requires' only for major phases if ( 1 ) { $prereqs = $meta->effective_prereqs; # get the object, not the hash if (eval "require $cpan_meta_req; 1") { ## no critic $all_requires = $cpan_meta_req->new; for my $phase ( qw/configure build test runtime/ ) { $all_requires->add_requirements( $prereqs->requirements_for($phase, 'requires') ); } } } } } my @reports = [qw/Version Module/]; my @dep_errors; my $req_hash = defined($all_requires) ? $all_requires->as_string_hash : {}; for my $mod ( @modules ) { next if $mod eq 'perl'; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e catfile($_, $file) } @INC; if ( $prefix ) { my $ver = MM->parse_version( catfile($prefix, $file) ); $ver = "undef" unless defined $ver; # Newer MM should do this anyway push @reports, [$ver, $mod]; if ( 1 && $all_requires ) { my $req = $req_hash->{$mod}; if ( defined $req && length $req ) { if ( ! defined eval { version->parse($ver) } ) { push @dep_errors, "$mod version '$ver' cannot be parsed (version '$req' required)"; } elsif ( ! $all_requires->accepts_module( $mod => $ver ) ) { push @dep_errors, "$mod version '$ver' is not in required range '$req'"; } } } } else { push @reports, ["missing", $mod]; if ( 1 && $all_requires ) { my $req = $req_hash->{$mod}; if ( defined $req && length $req ) { push @dep_errors, "$mod is not installed (version '$req' required)"; } } } } if ( @reports ) { my $vl = max map { length $_->[0] } @reports; my $ml = max map { length $_->[1] } @reports; splice @reports, 1, 0, ["-" x $vl, "-" x $ml]; diag "\nVersions for all modules listed in $source (including optional ones):\n", map {sprintf(" %*s %*s\n",$vl,$_->[0],-$ml,$_->[1])} @reports; } if ( @dep_errors ) { diag join("\n", "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", "The following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=2 sts=2 sw=2 et: MooseX-Getopt-0.59/t/001_basic.t000644 000767 000024 00000013741 12246433065 016501 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/002_custom_option_type.t000644 000767 000024 00000002464 12246433065 021364 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/003_inferred_option_type.t000644 000767 000024 00000001562 12246433065 021647 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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'; subtype 'ArrayOfInts' => as 'ArrayRef' => where { scalar (grep { looks_like_number($_) } @$_) }; 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'); } done_testing; MooseX-Getopt-0.59/t/004_nogetop.t000644 000767 000024 00000004242 12246433065 017072 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/005_strict.t000644 000767 000024 00000004076 12246433065 016735 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/006_metaclass_traits.t000644 000767 000024 00000013572 12246433065 020771 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/007_nogetopt_trait.t000644 000767 000024 00000004234 12246433065 020465 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/008_configfromfile.t000644 000767 000024 00000020227 12246433065 020415 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::Requires 'MooseX::ConfigFromFile'; # skip all if not installed use Test::More; 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 '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 ); { my $app = App->new_with_options; isa_ok( $app, 'App' ); app_ok( $app ); } { 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.59/t/009_gld_and_explicit_options.t000644 000767 000024 00000001336 12246433065 022471 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/010_dashes.t000644 000767 000024 00000001767 12246433065 016674 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/011_process_argv.t000644 000767 000024 00000001631 12246433065 020111 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/100_gld_default_bug.t000644 000767 000024 00000001446 12246433065 020526 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/101_argv_bug.t000644 000767 000024 00000001223 12246433065 017205 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/102_basic_basic.t000644 000767 000024 00000013541 12246433065 017642 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/103_uc_bug.t000644 000767 000024 00000001211 12246433065 016654 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/104_override_usage.t000644 000767 000024 00000004127 12246433065 020425 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; use Test::Trap; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Moose::Util 'find_meta'; { package MyScript; use Moose; with 'MooseX::Getopt'; has foo => ( isa => 'Int', is => 'ro', documentation => 'A foo' ); } # FIXME - it looks like we have a spacing issue in Getopt::Long? my $usage = <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 }; is($trap->stdout, $usage, 'usage is printed on --help'); } { local @ARGV = ('-q'); # Does not exist trap { MyScript->new_with_options }; is($trap->die, join("\n", 'Unknown option: q', $usage), '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 }; is( $trap->stdout, join("\n", '--- DOCUMENTATION ---', $usage), 'additional text included before normal usage string', ); } { package MyScript2; use Moose; with 'MooseX::Getopt'; has foo => ( isa => 'Int', is => 'ro', documentation => 'A foo' ); } { # 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 }; is( $trap->stdout, join("\n", '--- DOCUMENTATION ---', $usage), 'additional text included before normal usage string', ); } done_testing; MooseX-Getopt-0.59/t/105_uc_bug_more.t000644 000767 000024 00000002050 12246433065 017702 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/106_no_ignore_case.t000644 000767 000024 00000003164 12246433065 020376 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/107_no_auto_help.t000644 000767 000024 00000003604 12246433065 020100 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 FATAL => 'all'; use Test::Requires { 'MooseX::SimpleConfig' => 0.07 }; # skip all if not installed use Test::More; use Test::Deep; use Test::Fatal 0.003; use Test::Warnings qw(:no_end_test :all); my $fail_on_exit = 1; { package Class; use strict; use warnings FATAL => 'all'; 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.*--usage --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', ); ok(!$fail_on_exit, 'getoptions() lives'); had_no_warnings if $ENV{AUTHOR_TESTING}; done_testing; MooseX-Getopt-0.59/t/107_union_bug.t000644 000767 000024 00000002620 12246433065 017406 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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; MooseX-Getopt-0.59/t/108_usage_attr.t000644 000767 000024 00000001744 12246433065 017566 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 FATAL => 'all'; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package MyClass; use strict; use warnings FATAL => 'all'; 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.59/t/109_help_flag.t000644 000767 000024 00000003654 12246433065 017354 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 FATAL => 'all'; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; use Test::Trap; { package MyClass; use strict; use warnings FATAL => 'all'; 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.59/t/110_sort_usage_by_attr_order.t000644 000767 000024 00000002514 12246433065 022507 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 FATAL => 'all'; use Test::More; use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; { package MyClass; use strict; use warnings FATAL => 'all'; 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(); my $expected = <<"USAGE"; usage: 110_sort_usage_by_attr_order.t [-?h] [long options...] \t-h -? --usage --help Prints this usage information. \t--foo Documentation for "foo" \t--bar Documentation for "bar" \t--baz Documentation for "baz" USAGE is($obj->usage->text, $expected, 'Usage text has nicely sorted options'); done_testing; MooseX-Getopt-0.59/t/111_gld_pass_through.t000644 000767 000024 00000001624 12246433065 020753 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; use Test::More; 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.59/t/112_configfile_constructor_arg.t000644 000767 000024 00000001504 12246433065 023020 0ustar00etherstaff000000 000000 use strict; use warnings FATAL => 'all'; # respect the configfile value passed into the constructor. use Test::Requires 'MooseX::SimpleConfig'; # skip all if not installed use Test::More; 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', ); } { 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', ); } done_testing; MooseX-Getopt-0.59/t/112_configfile_constructor_arg.yml000644 000767 000024 00000000026 12246433065 023354 0ustar00etherstaff000000 000000 --- foo: foo value MooseX-Getopt-0.59/lib/MooseX/000755 000767 000024 00000000000 12246433065 016362 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/lib/MooseX/Getopt/000755 000767 000024 00000000000 12246433065 017624 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/lib/MooseX/Getopt.pm000644 000767 000024 00000025202 12246433065 020163 0ustar00etherstaff000000 000000 package MooseX::Getopt; { $MooseX::Getopt::VERSION = '0.59'; } # git description: v0.58-10-g8ae1f12 BEGIN { $MooseX::Getopt::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: A Moose role for processing command line options use Moose::Role 0.56; with 'MooseX::Getopt::GLD'; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine DWIM metaclass configfile Str subtype customizations =head1 NAME MooseX::Getopt - A Moose role for processing command line options =head1 VERSION version 0.59 =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 Getopt 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 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. 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 Getopt::Long 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 Getopt will not handle a --foo parameter, but your code can still call the C method. 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 Getopt::Long. So that this attribute description: has 'verbose' => (is => 'rw', isa => 'Bool'); would translate into C as a Getopt::Long option descriptor, which would enable the following command line options: % my_script.pl --verbose % my_script.pl --noverbose =item I, I, I These type constraints are set up as properly typed options with Getopt::Long, 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 Getopt::Long. So that this attribute description: has 'include' => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } ); would translate into C as a Getopt::Long 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 Getopt::Long. So that this attribute description: has 'define' => ( is => 'rw', isa => 'HashRef', default => sub { {} } ); would translate into C as a Getopt::Long option descriptor, which would enable the following command line options: % my_script.pl --define os=linux --define vendor=debian =back =head2 Custom Type Constraints 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 Getopt::Long 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 See L for many other customizations you can make to how options are parsed. Simply C in your class to set these. =head1 SEE ALSO L, an extension to generate man pages, with colour =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. =head1 CONTRIBUTORS =over 4 =item * Brandon L Black =item * Chris Prather =item * Dagfinn Ilmari Mannsåker =item * Damien Krotkine =item * Devin Austin =item * Drew Taylor =item * Florian Ragwitz =item * Gordon Irving =item * Hans Dieter Pearcey =item * Hinrik Örn Sigurðsson =item * Jesse Luehrs =item * John Goulah =item * Jonathan Swartz =item * Justin Hunter =item * Karen Etheridge =item * Nelo Onyiah =item * Ricardo SIGNES =item * Ryan D Johnson =item * Shlomi Fish =item * Stevan Little =item * Todd Hepler =item * Tomas Doran =item * Yuval Kogman =item * Ævar Arnfjörð Bjarmason =back =cut MooseX-Getopt-0.59/lib/MooseX/Getopt/Basic.pm000644 000767 000024 00000023225 12246433065 021207 0ustar00etherstaff000000 000000 package MooseX::Getopt::Basic; { $MooseX::Getopt::Basic::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::Basic::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: MooseX::Getopt::Basic - role to implement the Getopt::Long functionality 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 (); 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 => $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}); } 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); $class->new( ARGV => $pa->argv_copy, extra_argv => $pa->extra_argv, ( $pa->usage ? ( usage => $pa->usage ) : () ), %{ $pa->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; exit 0; } #(this is already documented in MooseX::Getopt. But FIXME later, via RT#82195) 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 $_->name !~ /^_/ } 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->name; 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) } } push @options, { 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({}) ) : () ), ( $attr->has_documentation ? ( doc => $attr->documentation ) : () ), } } return @options; } no Moose::Role; 1; __END__ =pod =encoding UTF-8 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine =head1 NAME MooseX::Getopt::Basic - MooseX::Getopt::Basic - role to implement the Getopt::Long functionality =head1 VERSION version 0.59 =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 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.59/lib/MooseX/Getopt/Dashes.pm000644 000767 000024 00000004474 12246433065 021402 0ustar00etherstaff000000 000000 package MooseX::Getopt::Dashes; { $MooseX::Getopt::Dashes::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::Dashes::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: convert underscores in attribute names to dashes use Moose::Role; with 'MooseX::Getopt'; 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 ); }; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine =head1 NAME MooseX::Getopt::Dashes - convert underscores in attribute names to dashes =head1 VERSION version 0.59 =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 C 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 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.59/lib/MooseX/Getopt/GLD.pm000644 000767 000024 00000010350 12246433065 020567 0ustar00etherstaff000000 000000 package MooseX::Getopt::GLD; { $MooseX::Getopt::GLD::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::GLD::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: A Moose role for processing command line options with Getopt::Long::Descriptive use strict; use warnings; use MooseX::Role::Parameterized; use Getopt::Long::Descriptive 0.081; with 'MooseX::Getopt::Basic'; 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', isa => 'Bool', 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 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine =head1 NAME MooseX::Getopt::GLD - A Moose role for processing command line options with Getopt::Long::Descriptive =head1 VERSION version 0.59 =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 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.59/lib/MooseX/Getopt/Meta/000755 000767 000024 00000000000 12246433065 020512 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/lib/MooseX/Getopt/OptionTypeMap.pm000644 000767 000024 00000007460 12246433065 022741 0ustar00etherstaff000000 000000 package MooseX::Getopt::OptionTypeMap; { $MooseX::Getopt::OptionTypeMap::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::OptionTypeMap::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: Storage for the option to type mappings use Moose 'confess', 'blessed'; use Moose::Util::TypeConstraints 'find_type_constraint'; 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; } no Moose::Util::TypeConstraints; no Moose; 1; __END__ =pod =encoding UTF-8 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine =head1 NAME MooseX::Getopt::OptionTypeMap - Storage for the option to type mappings =head1 VERSION version 0.59 =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 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.59/lib/MooseX/Getopt/ProcessedArgv.pm000644 000767 000024 00000004145 12246433065 022735 0ustar00etherstaff000000 000000 package MooseX::Getopt::ProcessedArgv; { $MooseX::Getopt::ProcessedArgv::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::ProcessedArgv::AUTHORITY = 'cpan:STEVAN'; } use Moose; # ABSTRACT: MooseX::Getopt::ProcessedArgv - Class containing the results of process_argv 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'); no Moose; __PACKAGE__->meta->make_immutable(); 1; __END__ =pod =encoding UTF-8 =for :stopwords Stevan Little Infinity Interactive, Inc =head1 NAME MooseX::Getopt::ProcessedArgv - MooseX::Getopt::ProcessedArgv - Class containing the results of process_argv =head1 VERSION version 0.59 =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 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.59/lib/MooseX/Getopt/Strict.pm000644 000767 000024 00000002262 12246433065 021434 0ustar00etherstaff000000 000000 package MooseX::Getopt::Strict; { $MooseX::Getopt::Strict::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::Strict::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: only make options for attributes with the Getopt metaclass use Moose::Role; with 'MooseX::Getopt'; around '_compute_getopt_attrs' => sub { my $next = shift; my ( $class, @args ) = @_; grep { $_->does("MooseX::Getopt::Meta::Attribute::Trait") } $class->$next(@args); }; no Moose::Role; 1; __END__ =pod =encoding UTF-8 =for :stopwords Stevan Little Infinity Interactive, Inc =head1 NAME MooseX::Getopt::Strict - only make options for attributes with the Getopt metaclass =head1 VERSION version 0.59 =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 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.59/lib/MooseX/Getopt/Meta/Attribute/000755 000767 000024 00000000000 12246433065 022455 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/lib/MooseX/Getopt/Meta/Attribute.pm000644 000767 000024 00000006456 12246433065 023026 0ustar00etherstaff000000 000000 package MooseX::Getopt::Meta::Attribute; { $MooseX::Getopt::Meta::Attribute::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::Meta::Attribute::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: Optional meta attribute for custom option names use Moose; use Moose::Util::TypeConstraints; extends 'Moose::Meta::Attribute'; # << Moose extending Moose :) with 'MooseX::Getopt::Meta::Attribute::Trait'; no Moose; # 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 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine =head1 NAME MooseX::Getopt::Meta::Attribute - Optional meta attribute for custom option names =head1 VERSION version 0.59 =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 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.59/lib/MooseX/Getopt/Meta/Attribute/NoGetopt.pm000644 000767 000024 00000005163 12246433065 024557 0ustar00etherstaff000000 000000 package MooseX::Getopt::Meta::Attribute::NoGetopt; { $MooseX::Getopt::Meta::Attribute::NoGetopt::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::Meta::Attribute::NoGetopt::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: Optional meta attribute for ignoring parameters use Moose; extends 'Moose::Meta::Attribute'; # << Moose extending Moose :) with 'MooseX::Getopt::Meta::Attribute::Trait::NoGetopt'; no Moose; # 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 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine =head1 NAME MooseX::Getopt::Meta::Attribute::NoGetopt - Optional meta attribute for ignoring parameters =head1 VERSION version 0.59 =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 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.59/lib/MooseX/Getopt/Meta/Attribute/Trait/000755 000767 000024 00000000000 12246433065 023540 5ustar00etherstaff000000 000000 MooseX-Getopt-0.59/lib/MooseX/Getopt/Meta/Attribute/Trait.pm000644 000767 000024 00000006021 12246433065 024075 0ustar00etherstaff000000 000000 package MooseX::Getopt::Meta::Attribute::Trait; { $MooseX::Getopt::Meta::Attribute::Trait::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::Meta::Attribute::Trait::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: Optional meta attribute trait for custom option names use Moose::Role; use Moose::Util::TypeConstraints; 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 subtype '_MooseX_Getopt_CmdAliases' => as 'ArrayRef'; coerce '_MooseX_Getopt_CmdAliases' => from 'Str' => via { [$_] }; has 'cmd_aliases' => ( is => 'rw', isa => '_MooseX_Getopt_CmdAliases', predicate => 'has_cmd_aliases', coerce => 1, ); no Moose::Util::TypeConstraints; no Moose::Role; # 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 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine =head1 NAME MooseX::Getopt::Meta::Attribute::Trait - Optional meta attribute trait for custom option names =head1 VERSION version 0.59 =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 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.59/lib/MooseX/Getopt/Meta/Attribute/Trait/NoGetopt.pm000644 000767 000024 00000003650 12246433065 025641 0ustar00etherstaff000000 000000 package MooseX::Getopt::Meta::Attribute::Trait::NoGetopt; { $MooseX::Getopt::Meta::Attribute::Trait::NoGetopt::VERSION = '0.59'; } BEGIN { $MooseX::Getopt::Meta::Attribute::Trait::NoGetopt::AUTHORITY = 'cpan:STEVAN'; } # ABSTRACT: Optional meta attribute trait for ignoring parameters use Moose::Role; no Moose::Role; # 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 =for :stopwords Stevan Little Infinity Interactive, Inc Brandon Devin Austin Drew Taylor Florian Ragwitz Gordon Irving Hans Dieter L Pearcey Hinrik Örn Sigurðsson Jesse Luehrs John Goulah Jonathan Swartz Black Justin Hunter Karen Etheridge Nelo Onyiah Ricardo SIGNES Ryan D Chris Johnson Shlomi Fish Todd Hepler Tomas Doran Yuval Prather Kogman Ævar Arnfjörð Bjarmason Dagfinn Ilmari Mannsåker Damien Krotkine =head1 NAME MooseX::Getopt::Meta::Attribute::Trait::NoGetopt - Optional meta attribute trait for ignoring parameters =head1 VERSION version 0.59 =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 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