@@ -1,445 +1,100 @@
-==================================================
-Changes from 1740-04-26 00:00:00 +0000 to present.
-==================================================
+Revision history for Perl module MooX::Cmd
+
+0.011 2014-12-03
+ - apply clean Perl::Tidy rules to avoid mixed spaces/tabs and other
+ settings
+ - add version number to MooX::Cmd::Tester
+ - allow overriding protected constructor when renaming public one
+
+0.010 2014-12-02
+ - switch distribution tooling from Dist::Zilla to ExtUtils::MakeMaker
+ - Added Changes file with content based on git log according to
+ CPAN::Changes::Spec (Neil Bowers)
+ - Apply typo fixes for documentation from David Steinbrunner
+ - Sven Schober provided heavily improved description
+
+0.009 2014-02-08
+ - Apply submitted fix for RT#91481 - without test ..
+ - fix RT#91500 - incorrect execute_return if ...
+ The implication was wrong, indeed - but the effort was increadible.
+ Testing sucks :P
+ - distinguish between test_cmd and test_cmd_ok
+ - after chained constructor, we can use getters
+ - add missing prereqs
+
+
+0.008 2013-11-13
+ - groundwork for testing with Mo(o(se))
+ - add THANKS section
+ - final test for MooX::Options 3.99
+ - eliminate hidden/private __moox_cmd_chain param
+ - massively increase test coverage
+
+
+0.007 2013-11-07
+ - improve test coverage of MooX::Cmd::Role
+ - 100% test coverage of MooX::Cmd
+ - add some documentation for MooX::Cmd::Tester
+ - ignore editor temp files and backup files
+ - enhance and fix tests
+ - Adopt basic tests using tester API
+ - steal some code from App::Cmd::Tester and adopt
+ Basic test infrastructure ... needs fine tuning, but first steps
+ are done that way.
+ - BAIL_OUT when unable to load MooX::Cmd
+ No further testing possible nor reasonable
+
+
+0.006001 2013-11-06
+ - remove superfluous "my" causing undef command_name
+
+
+0.006 2013-11-05
+ - Merge github.com:rehsack/MooX-Cmd
+
+
+0.005 2013-11-05
+ - Merge github.com:Getty/p5-moox-cmd into rehsack
+ - correct content of command_name attribute
+ - Merge github.com:Getty/p5-moox-cmd
+
+
+0.004 2013-11-02
+ - New travis config
+ - Add some comfort as primary author desires
+ To avoid scaring users the Getty wants some improved examples and an
+ accessor for last cmd in chain.
+ - Add some samples to role
+ author wants ('examples') x INT_MAX - unfortunately he gets only one
+ - Move initialization to MooX::Cmd::Role
+ - Improve documentation
+ - Allow Class->new_with_cmd->execute(...)
+ - Move initialization sequence for cmd into role
+ As discussed with primary author, a role having all neat information about
+ the cmd state in attributes is smarter that passing arguments ...
+ - Simplify loading commands to avoid stack frames
+ - Remove trailing \t
+ - Some safety first checks and minor optimizations
+ - Allow commands show available neighbours/children
+ - Merge github.com:Getty/p5-moox-cmd
+ - Merge pull request #2 from yanick/master
+ only load commands if used
+ - Bump Module::Pluggable version to stop 5.18 from
+ whining and let it work smoothly on blead
+
+
+0.003 2013-04-20
+ - Switched to Author::GETTY, added .travis.yml
+ - Don't load commands unless they are used
+ This should make things much more zippy if we have
+ more than a handful of commands.
+
+
+0.002 2012-05-07
+ - Added requirement for Package::Stash
+ - Added documentation (hope it works ;) as told hehe) and use of Package::Stash
+
+
+0.001 2012-02-10
+ - First release to CPAN
-------------------------------------------
-version 0.009 at 2014-02-08 16:00:22 +0000
-------------------------------------------
-
- Change: 0abd26c7a29d6b2d9b225af320891f224194996a
- Author: Diab Jerius <djerius@cpan.org>
- Date : 2014-02-01 22:17:39 +0000
-
- Apply submitted fix for RT#91481 - without test ..
-
- but with dist.ini updated ...
-
- Change: 98feae23ad3c3caa679df82083d6db2daeb63900
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2014-02-01 22:06:58 +0000
-
- fix RT#91500 - incorrect execute_return if ...
-
- The implication was wrong, indeed - but the effort was increadible.
- Testing sucks :P
-
- Change: 790ba58bc37a7104576c1bf741b98873e4562ae8
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2014-01-29 07:05:42 +0000
-
- distinguish between test_cmd and test_cmd_ok
-
- Change: f3c3dfcb7586a2922702c91bad012acf0031ad9c
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2014-01-29 07:04:20 +0000
-
- after chained constructor, we can use getters
-
- * here: use command_execute_return_method_name getter instead of
-
- hidden builder call and wasting the result
-
- Change: 6077f673f240f71bcdcd6e9e3cb09fef1de4ab2f
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-12-02 08:49:48 +0000
-
- add missing prereqs
-
- Change: 9d651fd16851227b7010d79b969f4880e97dd066
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-13 16:45:57 +0000
-
- groundwork for testing with Mo(o(se))
-
- Change: 1d03792c66e861893a3c51991f24353ea7314e4c
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-13 11:14:00 +0000
-
- add THANKS section
-
- Change: 13178346909c90cc22627066f699aa12c669fef2
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-13 11:13:32 +0000
-
- final test for MooX::Options 3.99
-
- Change: 7a54a5793c90f20b2949d6c76eef67dd9550b478
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-13 10:50:12 +0000
-
- eliminate hidden/private __moox_cmd_chain param
-
- Change: dae399076bca0401e75f7f23a4fbb09e04fb38eb
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-13 08:11:54 +0000
-
- prepare for MooX::Options 3.99
-
- Change: f7e930f69532758bbec8ed9e542e7e3baddff655
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-09 22:20:42 +0000
-
- massively increase test coverage
-
- Change: 4277fc1bfef1d923b359db3603feb9aab88d18b3
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-07 22:40:36 +0000
-
- improve test coverage of MooX::Cmd::Role
-
- Change: 4cd5c44f71d2c97dbe30d5709fc3318d4682338f
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-07 20:52:35 +0000
-
- 100% test coverage of MooX::Cmd
-
- Change: 56155528d3463680214507d42a53c5132b3be967
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-07 17:14:00 +0000
-
- add some documentation for MooX::Cmd::Tester
-
- Change: bcf96711d17f6f4ef2fca1c2ccb1372f9a08505d
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-07 15:34:46 +0000
-
- ignore editor temp files and backup files
-
- Change: 47ac05970ee0cc83fd6e1bc13559f51c320cb498
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-07 15:33:32 +0000
-
- enhance and fix tests
-
- Change: 638e1160066019da114e18858623bcb5f7cb272e
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-06 20:55:24 +0000
-
- Adopt basic tests using tester API
-
- Change: 3b22c88ca15a3e98c9221bab12288cf62ce4c1c3
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-06 20:54:22 +0000
-
- steal some code from App::Cmd::Tester and adopt
-
- Basic test infrastructure ... needs fine tuning, but first steps are
- done that way.
-
- Change: df7fae3c04dac8aba23a6dd693926cfd16a65fb4
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-06 20:53:40 +0000
-
- BAIL_OUT when unable to load MooX::Cmd
-
- No further testing possible nor reasonable
-
- Change: de7fcb9ab41a68831a8b1664c9d0f1830969014c
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-06 12:29:04 +0000
-
- remove superfluous "my" causing undef command_name
-
- Change: 4396f43078223c989bd9c5cc2734191ebc295d2a
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-05 20:12:38 +0000
-
- Merge github.com:rehsack/MooX-Cmd
-
- Change: c932a0edc9a0ab225b431f21a116af96becfcfa0
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-05 20:11:11 +0000
-
- v0.005
-
- Change: fc393333b0f91e30fcc6a8168b67c076ada2c113
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-05 07:45:35 +0000
-
- Merge github.com:Getty/p5-moox-cmd into rehsack
-
- Change: 25caa31cf72d62cc69eaaf207488ea93427c5e43
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-05 06:59:15 +0000
-
- correct content of command_name attribute
-
- Change: ded34606747f067473f9b778b213a184a0e69e6e
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-03 00:04:10 +0000
-
- Merge github.com:Getty/p5-moox-cmd
-
- Change: 474d456a510b53f357b96e346ba45160e554d0be
- Author: Torsten Raudssus <torsten@raudss.us>
- Date : 2013-11-02 23:06:50 +0000
-
- New travis config
-
- Change: 7ad16ca45b63d72deb5db6cbbce4f787046f6013
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- add some comfort as primary author desires
-
- To avoid scaring users the Getty wants some improved examples and an
- accessor for last cmd in chain.
-
- Change: 3b7ea438bf9d041895b37781e3ea20733caa5e08
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- add some samples to role
-
- author wants ('examples') x INT_MAX - unfortunately he gets only one
-
- Change: 16ab8ee5a435405b22a57c83b59bf2b6ce90ba5c
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- move initialization to MooX::Cmd::Role
-
- * as discussed with Getty in #web-simple, let MooX::Cmd be a
- bootstrap
-
- loader only and modern implementations can do
-
- with "MooX::Cmd::Role"; * allow modify all initialization parameters
- via class _build_ functions
-
- (called in class context, but as method)
-
- Change: e8b4dea42c571e7842f250b9d75bfc680dfe24ed
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- improve documentation
-
- Change: bd75c0701c52b3742a5c7aa53d7e058c6327d2e1
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- allow Class->new_with_cmd->execute(...)
-
- Change: 1e585ce9de10745e06d0399a9beaae4d090261d5
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- move initialization sequence for cmd into role
-
- as discussed with primary author, a role having all neat information
- about the cmd state in attributes is smarter that passing arguments
- ...
-
- Change: 8be5fbb8369983ae1e225b5b9ee1130f13c34169
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- simplify loading commands to avoid stack frames
-
- Change: 08355a05811a3df9b044f69eed504aaa0180eba1
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- remove trailing \t
-
- Change: 11c618f8bfc0563cc5a5ca44fdcfbcb160054cdf
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- some safety first checks and minor optimizations
-
- Change: bfbe63ec3572c8b0c62c77288f4939b04e05dfb8
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- allow commands show available neighbours/children
-
- Change: 1368cf9f99b5b9496d9ae4e78ef7a04dd3cbe9ee
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 23:00:05 +0000
-
- bump Module::Pluggable version to stop 5.18 from
-
- whining and let it work smoothly on blead
-
- Change: ec640c1ba69d8e52a189767dfe3944d2fbcfdc1b
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-02 22:55:35 +0000
-
- add some comfort as primary author desires
-
- To avoid scaring users the Getty wants some improved examples and an
- accessor for last cmd in chain.
-
- Change: 39ac03f9dade418d1c88f90eda86873fbf602b3e
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-01 13:08:20 +0000
-
- add some samples to role
-
- author wants ('examples') x INT_MAX - unfortunately he gets only one
-
- Change: e4b74eef3bdc5e6d9904f1357e70e82fc759f556
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-11-01 13:02:34 +0000
-
- move initialization to MooX::Cmd::Role
-
- * as discussed with Getty in #web-simple, let MooX::Cmd be a
- bootstrap
-
- loader only and modern implementations can do
-
- with "MooX::Cmd::Role"; * allow modify all initialization parameters
- via class _build_ functions
-
- (called in class context, but as method)
-
- Change: 7b2cab573584ae6991298e6f8626a94312427c8d
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-31 20:38:00 +0000
-
- improve documentation
-
- Change: 3a485f6effe485dc8f3f22617752e772b5e1a613
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-30 18:26:49 +0000
-
- allow Class->new_with_cmd->execute(...)
-
- Change: 45b4c59e4f4b2467106a4546fdf6807176e978a5
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-30 18:21:16 +0000
-
- move initialization sequence for cmd into role
-
- as discussed with primary author, a role having all neat information
- about the cmd state in attributes is smarter that passing arguments
- ...
-
- Change: 707f86b6bb9a14d31865e7fa45d247d559b934cf
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-30 15:53:47 +0000
-
- simplify loading commands to avoid stack frames
-
- Change: f0532663043704767fed5fcc40a7056f0bcedae6
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-30 15:36:42 +0000
-
- remove trailing \t
-
- Change: bb0c7bbb48a20030a23b72d769f35845914a448d
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-30 15:31:14 +0000
-
- some safety first checks and minor optimizations
-
- Change: 29a9d19b503186a872f4bc7a1c841cd593e86dd5
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-30 07:24:37 +0000
-
- Merge github.com:Getty/p5-moox-cmd
-
- Change: 03139b6fb4c4fb003661ceefd3522183d822985f
- Author: Torsten Raudssus <torsten@raudss.us>
- Date : 2013-10-29 11:07:19 +0000
-
- Merge pull request #2 from yanick/master
-
- only load commands if used
-
- Change: 07158eec8defbbd90ece5286710d5eff98d647e1
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-29 18:36:10 +0000
-
- allow commands show available neighbours/children
-
- Change: 6522c6e0fe8ef5af3ceb6495be735d02c44e081b
- Author: Jens Rehsack <sno@netbsd.org>
- Date : 2013-10-28 15:04:25 +0000
-
- bump Module::Pluggable version to stop 5.18 from
-
- whining and let it work smoothly on blead
-
- Change: 35958d42953eed37e26836cf5778bb077e614ecc
- Author: Torsten Raudssus <torsten@raudss.us>
- Date : 2013-04-21 01:24:58 +0000
-
- Switched to Author::GETTY, added .travis.yml
-
- Change: 54be2bfe8fde08039f8e9587a0184083afcbcd55
- Author: Yanick Champoux <yanick@babyl.dyndns.org>
- Date : 2013-04-03 22:36:05 +0000
-
- don't load commands unless they are used
-
- this should make things much more zippy if we have more than a
- handful of commands.
-
- Change: f70b220deeda4617bb30c67d93a96ac44fc3d780
- Author: Torsten Raudssus <torsten@raudss.us>
- Date : 2012-05-07 20:16:28 +0000
-
- v0.002
-
- Change: 2541301dd44f5ee0ab752cb755d61d97c0872389
- Author: Torsten Raudssus <torsten@raudss.us>
- Date : 2012-05-07 20:15:55 +0000
-
- Added requirement for Package::Stash
-
- Change: 8e659d1b5d517afa4839011575dc7f581c94b44a
- Author: Torsten Raudssus <torsten@raudss.us>
- Date : 2012-05-07 20:14:50 +0000
-
- Added documentation (hope it works ;) as told hehe) and use of
- Package::Stash
-
- Change: d49f4b4f81153f8b93caeab68a85fda28e0f5fc4
- Author: Torsten Raudssus <github@raudssus.de>
- Date : 2012-02-11 00:01:15 +0000
-
- v0.001
-
- Change: 194c35d75b020347387d468ef27f13593821ef16
- Author: Torsten Raudssus <github@raudssus.de>
- Date : 2012-02-11 00:00:15 +0000
-
- Added warning
-
- Change: 1557356c36859e34d7b6ec56c3ef45c5fc0f065d
- Author: Torsten Raudssus <github@raudssus.de>
- Date : 2012-02-10 23:59:29 +0000
-
- Still under heavy development... i hate my life ;)
-
- Change: 90a859aa2a7295cc5a8e7a039a048a685b13e390
- Author: Torsten Raudssus <github@raudssus.de>
- Date : 2012-02-10 05:03:14 +0000
-
- Ok.... that is not THAT easy ;) problem with command keyword
-
- Change: 61a6ef8cfde4a43755fc6edcd39781a666c19215
- Author: Torsten Raudssus <github@raudssus.de>
- Date : 2012-02-09 14:53:22 +0000
-
- More parameters
-
- Change: 492701658ba8bf78eec1d8e6166f20ee01340647
- Author: Torsten Raudssus <github@raudssus.de>
- Date : 2012-02-09 14:36:56 +0000
-
- Initial implementation, simple tests are working, stackable works
-
- Change: 5e5836b218405a040bc7ed25be3def4b182b5e14
- Author: Torsten Raudssus <github@raudssus.de>
- Date : 2012-02-07 19:27:13 +0000
-
- initial commit
-
-================
-End of releases.
-================
@@ -1,379 +0,0 @@
-This software is copyright (c) 2013 by Torsten Raudssus.
-
-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) 2013 by Torsten Raudssus.
-
-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.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
-
- 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.
-
- <signature of Ty Coon>, 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) 2013 by Torsten Raudssus.
-
-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
-
@@ -1,15 +1,11 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.012.
Changes
-LICENSE
-MANIFEST
-META.json
-META.yml
-Makefile.PL
-README
-dist.ini
lib/MooX/Cmd.pm
lib/MooX/Cmd/Role.pm
lib/MooX/Cmd/Tester.pm
+Makefile.PL
+MANIFEST This list of files
+MANIFEST.SKIP
+README.md
t/00-load.t
t/01-simple.t
t/02-moox-options.t
@@ -30,4 +26,5 @@ t/lib/SecondTestApp/Cmd/cwo.pm
t/lib/SecondTestApp/Cmd/ifc.pm
t/lib/ThirdTestApp.pm
t/lib/ThirdTestApp/Cmd/Foo.pm
-t/release-pod-syntax.t
+META.yml Module YAML meta-data (added by MakeMaker)
+META.json Module JSON meta-data (added by MakeMaker)
@@ -0,0 +1,32 @@
+\B\.svn\b
+\B\.git\b
+\.gitignore$
+\.[Bb][Aa][Kk]$
+\.orig$
+\.old$
+\.tdy$
+\.tmp$
+\..*swp
+^Makefile$
+^Build$
+^Build\.bat$
+\.Inline/.*
+_Inline/.*
+\.bak$
+\.tar$
+\.tgz$
+\.tar\.gz$
+^mess/
+^tmp/
+^testdata/
+^blib/
+^sandbox/
+^pm_to_blib$
+^_build/.*
+~$
+.*\.planner
+^\..*
+MooX-Cmd-.*
+\bxt
+^MYMETA\.json$
+^MYMETA\..*$
@@ -1,10 +1,11 @@
{
"abstract" : "Giving an easy Moo style way to make command organized CLI apps",
"author" : [
+ "Jens Rehsack <rehsack@cpan.org>",
"Torsten Raudssus <torsten@raudss.us>"
],
- "dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 5.012, CPAN::Meta::Converter version 2.133380",
+ "dynamic_config" : 1,
+ "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.143240",
"license" : [
"perl_5"
],
@@ -13,391 +14,69 @@
"version" : "2"
},
"name" : "MooX-Cmd",
+ "no_index" : {
+ "directory" : [
+ "t",
+ "inc"
+ ]
+ },
"prereqs" : {
+ "build" : {
+ "requires" : {}
+ },
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : "6.30"
+ "ExtUtils::MakeMaker" : "0"
}
},
"develop" : {
"requires" : {
- "Test::Pod" : "1.41"
+ "Module::CPANTS::Analyse" : "0.96",
+ "Test::CPAN::Changes" : "0",
+ "Test::CheckManifest" : "0",
+ "Test::Kwalitee" : "0",
+ "Test::Pod" : "0",
+ "Test::Pod::Coverage" : "0",
+ "Test::Pod::Spelling::CommonMistakes" : "0",
+ "Test::Spelling" : "0"
}
},
"runtime" : {
"requires" : {
- "IO::TieCombine" : "0",
+ "Carp" : "0",
+ "List::Util" : "0",
"Module::Pluggable" : "4.8",
+ "Module::Runtime" : "0",
"Moo" : "0.009013",
"Package::Stash" : "0.33",
"Params::Util" : "0.37",
"Regexp::Common" : "2011121001",
- "Test::More" : "0.98",
- "Text::ParseWords" : "0"
+ "Scalar::Util" : "0",
+ "Text::ParseWords" : "0",
+ "perl" : "v5.8.1"
}
},
"test" : {
"requires" : {
- "Test::LoadAllModules" : "0.021",
+ "IO::TieCombine" : "0",
"Test::More" : "0.98"
}
}
},
"release_status" : "stable",
"resources" : {
- "homepage" : "https://github.com/Getty/p5-moox-cmd",
- "repository" : {
- "type" : "git",
- "url" : "https://github.com/Getty/p5-moox-cmd.git",
- "web" : "https://github.com/Getty/p5-moox-cmd"
- }
- },
- "version" : "0.009",
- "x_Dist_Zilla" : {
- "perl" : {
- "version" : "5.018002"
+ "bugtracker" : {
+ "mailto" : "moox-cmd@rt.cpan.org",
+ "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=MooX-Cmd"
},
- "plugins" : [
- {
- "class" : "Dist::Zilla::Plugin::GatherDir",
- "name" : "@Author::GETTY/@Basic/GatherDir",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::PruneCruft",
- "name" : "@Author::GETTY/@Basic/PruneCruft",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::ManifestSkip",
- "name" : "@Author::GETTY/@Basic/ManifestSkip",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::MetaYAML",
- "name" : "@Author::GETTY/@Basic/MetaYAML",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::License",
- "name" : "@Author::GETTY/@Basic/License",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::Readme",
- "name" : "@Author::GETTY/@Basic/Readme",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::ExtraTests",
- "name" : "@Author::GETTY/@Basic/ExtraTests",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::ExecDir",
- "name" : "@Author::GETTY/@Basic/ExecDir",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::ShareDir",
- "name" : "@Author::GETTY/@Basic/ShareDir",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::MakeMaker",
- "name" : "@Author::GETTY/@Basic/MakeMaker",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::Manifest",
- "name" : "@Author::GETTY/@Basic/Manifest",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::TestRelease",
- "name" : "@Author::GETTY/@Basic/TestRelease",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::ConfirmRelease",
- "name" : "@Author::GETTY/@Basic/ConfirmRelease",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::UploadToCPAN",
- "name" : "@Author::GETTY/@Basic/UploadToCPAN",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::NextVersion",
- "name" : "@Author::GETTY/Git::NextVersion",
- "version" : "2.019"
- },
- {
- "class" : "Dist::Zilla::Plugin::PkgVersion",
- "name" : "@Author::GETTY/PkgVersion",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::MetaConfig",
- "name" : "@Author::GETTY/MetaConfig",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::MetaJSON",
- "name" : "@Author::GETTY/MetaJSON",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::PodSyntaxTests",
- "name" : "@Author::GETTY/PodSyntaxTests",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::Repository",
- "name" : "@Author::GETTY/Repository",
- "version" : "0.19"
- },
- {
- "class" : "Dist::Zilla::Plugin::GithubMeta",
- "name" : "@Author::GETTY/GithubMeta",
- "version" : "0.42"
- },
- {
- "class" : "Dist::Zilla::Plugin::TravisCI",
- "name" : "@Author::GETTY/TravisCI",
- "version" : "0.003"
- },
- {
- "class" : "Dist::Zilla::Plugin::InstallRelease",
- "name" : "@Author::GETTY/InstallRelease",
- "version" : "0.008"
- },
- {
- "class" : "Dist::Zilla::Plugin::Authority",
- "name" : "@Author::GETTY/Authority",
- "version" : "1.006"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch",
- "name" : "@Author::GETTY/Git::CheckFor::CorrectBranch",
- "version" : "0.009"
- },
- {
- "class" : "Dist::Zilla::Plugin::Prereqs",
- "config" : {
- "Dist::Zilla::Plugin::Prereqs" : {
- "phase" : "test",
- "type" : "requires"
- }
- },
- "name" : "@Author::GETTY/TestsOfAuthorGETTY",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::ChangelogFromGit",
- "name" : "@Author::GETTY/ChangelogFromGit",
- "version" : "0.015"
- },
- {
- "class" : "Dist::Zilla::Plugin::PodWeaver",
- "config" : {
- "Dist::Zilla::Plugin::PodWeaver" : {
- "config_plugins" : [
- "@Author::GETTY"
- ],
- "finder" : [
- ":InstallModules",
- ":ExecFiles"
- ],
- "plugins" : [
- {
- "class" : "Pod::Weaver::Plugin::EnsurePod5",
- "name" : "@CorePrep/EnsurePod5",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Plugin::H1Nester",
- "name" : "@CorePrep/H1Nester",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Name",
- "name" : "@GETTY/Name",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Version",
- "name" : "@GETTY/Version",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Region",
- "name" : "@GETTY/Prelude",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Generic",
- "name" : "@GETTY/Synopsis",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Generic",
- "name" : "@GETTY/Description",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Generic",
- "name" : "@GETTY/Overview",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Generic",
- "name" : "@GETTY/Stability",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Collect",
- "name" : "Attributes",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Collect",
- "name" : "Methods",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Collect",
- "name" : "Functions",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Leftovers",
- "name" : "@GETTY/Leftovers",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Region",
- "name" : "@GETTY/postlude",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Bugs",
- "name" : "@GETTY/Bugs",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Authors",
- "name" : "@GETTY/Authors",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Section::Legal",
- "name" : "@GETTY/Legal",
- "version" : "4.006"
- },
- {
- "class" : "Pod::Weaver::Plugin::Transformer",
- "name" : "@GETTY/List",
- "version" : "4.006"
- }
- ]
- }
- },
- "name" : "@Author::GETTY/PodWeaver",
- "version" : "4.005"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Check",
- "name" : "@Author::GETTY/@Git/Check",
- "version" : "2.019"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Commit",
- "name" : "@Author::GETTY/@Git/Commit",
- "version" : "2.019"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Tag",
- "name" : "@Author::GETTY/@Git/Tag",
- "version" : "2.019"
- },
- {
- "class" : "Dist::Zilla::Plugin::Git::Push",
- "name" : "@Author::GETTY/@Git/Push",
- "version" : "2.019"
- },
- {
- "class" : "Dist::Zilla::Plugin::Prereqs",
- "config" : {
- "Dist::Zilla::Plugin::Prereqs" : {
- "phase" : "runtime",
- "type" : "requires"
- }
- },
- "name" : "Prereqs",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::Prereqs",
- "config" : {
- "Dist::Zilla::Plugin::Prereqs" : {
- "phase" : "test",
- "type" : "requires"
- }
- },
- "name" : "TestRequires",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":InstallModules",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":IncModules",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":TestFiles",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":ExecFiles",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":ShareFiles",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":MainModule",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":AllFiles",
- "version" : "5.012"
- },
- {
- "class" : "Dist::Zilla::Plugin::FinderCode",
- "name" : ":NoFiles",
- "version" : "5.012"
- }
+ "homepage" : "https://metacpan.org/release/MooX-Cmd",
+ "license" : [
+ "http://dev.perl.org/licenses/"
],
- "zilla" : {
- "class" : "Dist::Zilla::Dist::Builder",
- "config" : {
- "is_trial" : "0"
- },
- "version" : "5.012"
+ "repository" : {
+ "type" : "git",
+ "web" : "https://github.com/Getty/MooX-Cmd"
}
},
- "x_authority" : "cpan:GETTY"
+ "version" : "0.011"
}
-
@@ -1,299 +1,39 @@
---
abstract: 'Giving an easy Moo style way to make command organized CLI apps'
author:
+ - 'Jens Rehsack <rehsack@cpan.org>'
- 'Torsten Raudssus <torsten@raudss.us>'
build_requires:
- Test::LoadAllModules: '0.021'
+ IO::TieCombine: '0'
Test::More: '0.98'
configure_requires:
- ExtUtils::MakeMaker: '6.30'
-dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.012, CPAN::Meta::Converter version 2.133380'
+ ExtUtils::MakeMaker: '0'
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version 2.143240'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: MooX-Cmd
+no_index:
+ directory:
+ - t
+ - inc
requires:
- IO::TieCombine: '0'
+ Carp: '0'
+ List::Util: '0'
Module::Pluggable: '4.8'
+ Module::Runtime: '0'
Moo: '0.009013'
Package::Stash: '0.33'
Params::Util: '0.37'
Regexp::Common: '2011121001'
- Test::More: '0.98'
+ Scalar::Util: '0'
Text::ParseWords: '0'
+ perl: v5.8.1
resources:
- homepage: https://github.com/Getty/p5-moox-cmd
- repository: https://github.com/Getty/p5-moox-cmd.git
-version: '0.009'
-x_Dist_Zilla:
- perl:
- version: '5.018002'
- plugins:
- -
- class: Dist::Zilla::Plugin::GatherDir
- name: '@Author::GETTY/@Basic/GatherDir'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::PruneCruft
- name: '@Author::GETTY/@Basic/PruneCruft'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::ManifestSkip
- name: '@Author::GETTY/@Basic/ManifestSkip'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::MetaYAML
- name: '@Author::GETTY/@Basic/MetaYAML'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::License
- name: '@Author::GETTY/@Basic/License'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::Readme
- name: '@Author::GETTY/@Basic/Readme'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::ExtraTests
- name: '@Author::GETTY/@Basic/ExtraTests'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::ExecDir
- name: '@Author::GETTY/@Basic/ExecDir'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::ShareDir
- name: '@Author::GETTY/@Basic/ShareDir'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::MakeMaker
- name: '@Author::GETTY/@Basic/MakeMaker'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::Manifest
- name: '@Author::GETTY/@Basic/Manifest'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::TestRelease
- name: '@Author::GETTY/@Basic/TestRelease'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::ConfirmRelease
- name: '@Author::GETTY/@Basic/ConfirmRelease'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::UploadToCPAN
- name: '@Author::GETTY/@Basic/UploadToCPAN'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::Git::NextVersion
- name: '@Author::GETTY/Git::NextVersion'
- version: '2.019'
- -
- class: Dist::Zilla::Plugin::PkgVersion
- name: '@Author::GETTY/PkgVersion'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::MetaConfig
- name: '@Author::GETTY/MetaConfig'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::MetaJSON
- name: '@Author::GETTY/MetaJSON'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::PodSyntaxTests
- name: '@Author::GETTY/PodSyntaxTests'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::Repository
- name: '@Author::GETTY/Repository'
- version: '0.19'
- -
- class: Dist::Zilla::Plugin::GithubMeta
- name: '@Author::GETTY/GithubMeta'
- version: '0.42'
- -
- class: Dist::Zilla::Plugin::TravisCI
- name: '@Author::GETTY/TravisCI'
- version: '0.003'
- -
- class: Dist::Zilla::Plugin::InstallRelease
- name: '@Author::GETTY/InstallRelease'
- version: '0.008'
- -
- class: Dist::Zilla::Plugin::Authority
- name: '@Author::GETTY/Authority'
- version: '1.006'
- -
- class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch
- name: '@Author::GETTY/Git::CheckFor::CorrectBranch'
- version: '0.009'
- -
- class: Dist::Zilla::Plugin::Prereqs
- config:
- Dist::Zilla::Plugin::Prereqs:
- phase: test
- type: requires
- name: '@Author::GETTY/TestsOfAuthorGETTY'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::ChangelogFromGit
- name: '@Author::GETTY/ChangelogFromGit'
- version: '0.015'
- -
- class: Dist::Zilla::Plugin::PodWeaver
- config:
- Dist::Zilla::Plugin::PodWeaver:
- config_plugins:
- - '@Author::GETTY'
- finder:
- - ':InstallModules'
- - ':ExecFiles'
- plugins:
- -
- class: Pod::Weaver::Plugin::EnsurePod5
- name: '@CorePrep/EnsurePod5'
- version: '4.006'
- -
- class: Pod::Weaver::Plugin::H1Nester
- name: '@CorePrep/H1Nester'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Name
- name: '@GETTY/Name'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Version
- name: '@GETTY/Version'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Region
- name: '@GETTY/Prelude'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Generic
- name: '@GETTY/Synopsis'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Generic
- name: '@GETTY/Description'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Generic
- name: '@GETTY/Overview'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Generic
- name: '@GETTY/Stability'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Collect
- name: Attributes
- version: '4.006'
- -
- class: Pod::Weaver::Section::Collect
- name: Methods
- version: '4.006'
- -
- class: Pod::Weaver::Section::Collect
- name: Functions
- version: '4.006'
- -
- class: Pod::Weaver::Section::Leftovers
- name: '@GETTY/Leftovers'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Region
- name: '@GETTY/postlude'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Bugs
- name: '@GETTY/Bugs'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Authors
- name: '@GETTY/Authors'
- version: '4.006'
- -
- class: Pod::Weaver::Section::Legal
- name: '@GETTY/Legal'
- version: '4.006'
- -
- class: Pod::Weaver::Plugin::Transformer
- name: '@GETTY/List'
- version: '4.006'
- name: '@Author::GETTY/PodWeaver'
- version: '4.005'
- -
- class: Dist::Zilla::Plugin::Git::Check
- name: '@Author::GETTY/@Git/Check'
- version: '2.019'
- -
- class: Dist::Zilla::Plugin::Git::Commit
- name: '@Author::GETTY/@Git/Commit'
- version: '2.019'
- -
- class: Dist::Zilla::Plugin::Git::Tag
- name: '@Author::GETTY/@Git/Tag'
- version: '2.019'
- -
- class: Dist::Zilla::Plugin::Git::Push
- name: '@Author::GETTY/@Git/Push'
- version: '2.019'
- -
- class: Dist::Zilla::Plugin::Prereqs
- config:
- Dist::Zilla::Plugin::Prereqs:
- phase: runtime
- type: requires
- name: Prereqs
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::Prereqs
- config:
- Dist::Zilla::Plugin::Prereqs:
- phase: test
- type: requires
- name: TestRequires
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::FinderCode
- name: ':InstallModules'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::FinderCode
- name: ':IncModules'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::FinderCode
- name: ':TestFiles'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::FinderCode
- name: ':ExecFiles'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::FinderCode
- name: ':ShareFiles'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::FinderCode
- name: ':MainModule'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::FinderCode
- name: ':AllFiles'
- version: '5.012'
- -
- class: Dist::Zilla::Plugin::FinderCode
- name: ':NoFiles'
- version: '5.012'
- zilla:
- class: Dist::Zilla::Dist::Builder
- config:
- is_trial: '0'
- version: '5.012'
-x_authority: cpan:GETTY
+ bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=MooX-Cmd
+ homepage: https://metacpan.org/release/MooX-Cmd
+ license: http://dev.perl.org/licenses/
+ repository: https://github.com/Getty/MooX-Cmd
+version: '0.011'
@@ -1,69 +1,127 @@
-
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.012.
use strict;
use warnings;
+use 5.008001;
+use ExtUtils::MakeMaker;
-use ExtUtils::MakeMaker 6.30;
-
-
-
-my %WriteMakefileArgs = (
- "ABSTRACT" => "Giving an easy Moo style way to make command organized CLI apps",
- "AUTHOR" => "Torsten Raudssus <torsten\@raudss.us>",
- "BUILD_REQUIRES" => {},
- "CONFIGURE_REQUIRES" => {
- "ExtUtils::MakeMaker" => "6.30"
- },
- "DISTNAME" => "MooX-Cmd",
- "EXE_FILES" => [],
- "LICENSE" => "perl",
- "NAME" => "MooX::Cmd",
- "PREREQ_PM" => {
- "IO::TieCombine" => 0,
- "Module::Pluggable" => "4.8",
+my %RUN_DEPS = (
+ "Carp" => 0,
+ "List::Util" => 0,
"Moo" => "0.009013",
+ "Module::Pluggable" => "4.8",
+ "Module::Runtime" => 0,
"Package::Stash" => "0.33",
"Params::Util" => "0.37",
"Regexp::Common" => "2011121001",
- "Test::More" => "0.98",
- "Text::ParseWords" => 0
- },
- "TEST_REQUIRES" => {
- "Test::LoadAllModules" => "0.021",
- "Test::More" => "0.98"
- },
- "VERSION" => "0.009",
- "test" => {
- "TESTS" => "t/*.t"
- }
+ "Scalar::Util" => 0,
+ "Text::ParseWords" => 0,
);
-
-my %FallbackPrereqs = (
- "IO::TieCombine" => 0,
- "Module::Pluggable" => "4.8",
- "Moo" => "0.009013",
- "Package::Stash" => "0.33",
- "Params::Util" => "0.37",
- "Regexp::Common" => "2011121001",
- "Test::LoadAllModules" => "0.021",
- "Test::More" => "0.98",
- "Text::ParseWords" => 0
+my %CONFIGURE_DEPS = (
+ 'ExtUtils::MakeMaker' => 0,
);
+my %BUILD_DEPS = ();
-unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
- delete $WriteMakefileArgs{TEST_REQUIRES};
- delete $WriteMakefileArgs{BUILD_REQUIRES};
- $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
-}
-
-delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
- unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
-
-WriteMakefile(%WriteMakefileArgs);
-
+my %TEST_DEPS = (
+ "Test::More" => 0.98,
+ "IO::TieCombine" => 0,
+);
+WriteMakefile1(
+ MIN_PERL_VERSION => '5.008001',
+ META_ADD => {
+ 'meta-spec' => { version => 2 },
+ resources => {
+ homepage => 'https://metacpan.org/release/MooX-Cmd',
+ repository => {
+ url => 'git@github.com:Getty/MooX-Cmd.git',
+ web => 'https://github.com/Getty/MooX-Cmd',
+ type => 'git',
+ },
+ bugtracker => {
+ web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=MooX-Cmd',
+ mailto => 'moox-cmd@rt.cpan.org',
+ },
+ license => 'http://dev.perl.org/licenses/',
+ },
+ prereqs => {
+ develop => {
+ requires => {
+ 'Test::CPAN::Changes' => 0,
+ 'Test::CheckManifest' => 0,
+ 'Module::CPANTS::Analyse' => '0.96',
+ 'Test::Kwalitee' => 0,
+ 'Test::Pod' => 0,
+ 'Test::Pod::Coverage' => 0,
+ 'Test::Pod::Spelling::CommonMistakes' => 0,
+ 'Test::Spelling' => 0,
+ },
+ },
+ configure => {
+ requires => {%CONFIGURE_DEPS},
+ },
+ build => { requires => {%BUILD_DEPS} },
+ test => { requires => {%TEST_DEPS} },
+ runtime => {
+ requires => {
+ %RUN_DEPS,
+ perl => '5.8.1',
+ },
+ },
+ },
+ },
+ NAME => 'MooX::Cmd',
+ VERSION_FROM => 'lib/MooX/Cmd.pm',
+ ABSTRACT_FROM => 'lib/MooX/Cmd.pm',
+ LICENSE => 'perl',
+ AUTHOR => [ q{Jens Rehsack <rehsack@cpan.org>}, q{Torsten Raudssus <torsten@raudss.us>} ],
+ PREREQ_PM => \%RUN_DEPS,
+ CONFIGURE_REQUIRES => \%CONFIGURE_DEPS,
+ BUILD_REQUIRES => \%BUILD_DEPS,
+ TEST_REQUIRES => \%TEST_DEPS,
+ test => { TESTS => 't/*.t xt/*.t' },
+);
+sub WriteMakefile1
+{ # originally written by Alexandr Ciornii, version 0.21. Added by eumm-upgrade.
+ my %params = @_;
+ my $eumm_version = $ExtUtils::MakeMaker::VERSION;
+ $eumm_version = eval $eumm_version;
+ die "EXTRA_META is deprecated" if ( exists( $params{EXTRA_META} ) );
+ die "License not specified" if ( !exists( $params{LICENSE} ) );
+ $params{TEST_REQUIRES}
+ and $eumm_version < 6.6303
+ and $params{BUILD_REQUIRES} =
+ $params{BUILD_REQUIRES} ? { %{ $params{BUILD_REQUIRES} }, %{ $params{TEST_REQUIRES} } } : delete $params{TEST_REQUIRES};
+ #EUMM 6.5502 has problems with BUILD_REQUIRES
+ $params{BUILD_REQUIRES}
+ and $eumm_version < 6.5503
+ and $params{PREREQ_PM} = { %{ $params{PREREQ_PM} || {} }, %{ delete $params{BUILD_REQUIRES} } };
+ delete $params{CONFIGURE_REQUIRES} if ( $eumm_version < 6.52 );
+ delete $params{MIN_PERL_VERSION} if ( $eumm_version < 6.48 );
+ delete $params{META_MERGE} if ( $eumm_version < 6.46 );
+ delete $params{META_ADD}{prereqs} if ( $eumm_version < 6.58 );
+ delete $params{META_ADD}{'meta-spec'} if ( $eumm_version < 6.58 );
+ delete $params{META_ADD} if ( $eumm_version < 6.46 );
+ delete $params{LICENSE} if ( $eumm_version < 6.31 );
+ delete $params{AUTHOR} if ( $] < 5.005 );
+ delete $params{ABSTRACT_FROM} if ( $] < 5.005 );
+ delete $params{BINARY_LOCATION} if ( $] < 5.005 );
+
+ # more or less taken from Moose' Makefile.PL
+ if ( $params{CONFLICTS} )
+ {
+ my $ok = CheckConflicts(%params);
+ exit(0) if ( $params{PREREQ_FATAL} and not $ok );
+ my $cpan_smoker = grep { $_ =~ m/(?:CR_SMOKER|CPAN_REPORTER|AUTOMATED_TESTING)/ } keys %ENV;
+ unless ( $cpan_smoker || $ENV{PERL_MM_USE_DEFAULT} )
+ {
+ sleep 4 unless ($ok);
+ }
+ delete $params{CONFLICTS};
+ }
+
+ WriteMakefile(%params);
+}
@@ -1,15 +0,0 @@
-
-
-This archive contains the distribution MooX-Cmd,
-version 0.009:
-
- Giving an easy Moo style way to make command organized CLI apps
-
-This software is copyright (c) 2013 by Torsten Raudssus.
-
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
-
-
-This README file was generated by Dist::Zilla::Plugin::Readme v5.012.
-
@@ -0,0 +1,47 @@
+## Name
+
+ MooX::Cmd - Giving an easy Moo style way to make command organized CLI apps
+
+## Description
+
+ Eases the writing of command line utilities, accepting commands and
+ subcommands and so on. These commands can form a tree, which is
+ mirrored in the package structure. On invocation each command along
+ the path through the tree (starting from the toplevel command
+ through to the most specific one) is instanciated.
+
+## Author
+
+ Torsten Raudssus, "<torsten at raudss.us>"
+ Jens Rehsack, "<rehsack at cpan.org>"
+
+## BUGS
+
+ Please report any bugs or feature requests to "bug-moox-cmd
+ at rt.cpan.org", or through the web interface at
+ <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooX-Cmd>. I
+ will be notified, and then you'll automatically be notified
+ of progress on your bug as I make changes.
+
+## Support
+
+ Repository
+
+ http://github.com/Getty/p5-moox-cmd
+ Pull request and additional contributors are welcome
+
+ Issue Tracker
+
+ http://github.com/Getty/p5-moox-cmd/issues
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooX-Cmd
+ bug-moox-cmd at rt.cpan.org
+
+## License And Copyright
+
+ Copyright 2012-2013 Torsten Raudssus, Copyright 2013-2014 Jens Rehsack.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of either: the GNU General Public License as published
+ by the Free Software Foundation; or the Artistic License.
+
+ See <http://dev.perl.org/licenses/> for more information.
@@ -1,20 +0,0 @@
-name = MooX-Cmd
-author = Torsten Raudssus <torsten@raudss.us>
-license = Perl_5
-copyright_holder = Torsten Raudssus
-copyright_year = 2013
-
-[@Author::GETTY]
-
-[Prereqs]
-Moo = 0.009013
-Regexp::Common = 2011121001
-Module::Pluggable = 4.8
-Package::Stash = 0.33
-Params::Util = 0.37
-Test::More = 0
-Text::ParseWords = 0
-IO::TieCombine = 0
-
-[Prereqs / TestRequires]
-Test::More = 0.98
@@ -1,12 +1,10 @@
package MooX::Cmd::Role;
-BEGIN {
- $MooX::Cmd::Role::AUTHORITY = 'cpan:GETTY';
-}
-# ABSTRACT: MooX cli app commands do this
-$MooX::Cmd::Role::VERSION = '0.009';
+
use strict;
use warnings;
+our $VERSION = "0.011";
+
use Moo::Role;
use Carp;
@@ -19,210 +17,10 @@ use List::Util qw/first/;
use Scalar::Util qw/blessed/;
use Params::Util qw/_ARRAY/;
-
-has 'command_args' => ( is => "ro" );
-
-
-has 'command_chain' => ( is => "ro" );
-
-
-has 'command_chain_end' => ( is => "lazy" );
-
-sub _build_command_chain_end { $_[0]->command_chain->[-1] }
-
-
-has 'command_name' => ( is => "ro" );
-
-
-has 'command_commands' => ( is => "lazy" );
-
-sub _build_command_commands
-{
- my ($class, $params) = @_;
- defined $params->{command_base} or $params->{command_base} = $class->_build_command_base($params);
- my $base = $params->{command_base};
-
- # i have no clue why 'only' and 'except' seems to not fulfill what i need or are bugged in M::P - Getty
- my @cmd_plugins = grep {
- my $plug_class = $_;
- $plug_class =~ s/${base}:://;
- $plug_class !~ /:/;
- } Module::Pluggable::Object->new(
- search_path => $base,
- require => 0,
- )->plugins;
-
- my %cmds;
-
- for my $cmd_plugin (@cmd_plugins) {
- $cmds{_mkcommand($cmd_plugin,$base)} = $cmd_plugin;
- }
-
- \%cmds;
-}
-
-
-has command_base => ( is => "lazy" );
-
-sub _build_command_base
-{
- my $class = blessed $_[0] || $_[0];
- return $class . '::Cmd'
-}
-
-
-has command_execute_method_name => ( is => "lazy" );
-
-sub _build_command_execute_method_name { "execute" }
-
-
-has command_execute_return_method_name => ( is => "lazy" );
-
-sub _build_command_execute_return_method_name { "execute_return" }
-
-
-has command_creation_method_name => ( is => "lazy" );
-
-sub _build_command_creation_method_name { "new_with_cmd" }
-
-
-has command_creation_chain_methods => ( is => "lazy" );
-
-sub _build_command_creation_chain_methods { ['new_with_options','new'] }
-
-
-has command_execute_from_new => ( is => "lazy" );
-
-sub _build_command_execute_from_new { 0 }
-
-
-sub new_with_cmd { goto &_initialize_from_cmd; }
-
-sub _mkcommand {
- my ( $package, $base ) = @_;
- $package =~ s/^${base}:://g;
- lc($package);
-}
-
-my @private_init_params = qw(command_base command_execute_method_name command_execute_return_method_name command_creation_chain_methods command_execute_method_name);
-
-my $required_method = sub {
- my ($tgt, $method) = @_;
- $tgt->can($method) or croak("You need an '$method' in " . (blessed $tgt || $tgt));
-};
-
-my $call_required_method = sub {
- my ($tgt, $method, @args) = @_;
- my $m = $required_method->($tgt, $method);
- return $m->($tgt, @args);
-};
-
-my $call_optional_method = sub {
- my ($tgt, $method, @args) = @_;
- my $m = $tgt->can($method) or return;
- return $m->($tgt, @args);
-};
-
-my $call_indirect_method = sub {
- my ($tgt, $name_getter, @args) = @_;
- my $g = $call_required_method->($tgt, $name_getter);
- my $m = $required_method->($tgt, $g);
- return $m->($tgt, @args);
-};
-
-sub _initialize_from_cmd
-{
- my ( $class, %params ) = @_;
-
- my @args = shellwords( join ' ', map { quotemeta } @ARGV );
-
- my (@used_args, $cmd, $cmd_name);
-
- my %cmd_create_params = %params;
- delete @cmd_create_params{qw(command_commands), @private_init_params};
-
- defined $params{command_commands} or $params{command_commands} = $class->_build_command_commands(\%params);
- while (my $arg = shift @args) {
- push @used_args, $arg and next unless $cmd = $params{command_commands}->{$arg};
-
- $cmd_name = $arg; # be careful about relics
- use_module( $cmd );
- defined $cmd_create_params{command_execute_method_name}
- or $cmd_create_params{command_execute_method_name} = $call_optional_method->(
- $cmd, "_build_command_execute_method_name", \%cmd_create_params);
- defined $cmd_create_params{command_execute_method_name}
- or $cmd_create_params{command_execute_method_name} = "execute";
- $required_method->($cmd, $cmd_create_params{command_execute_method_name});
- last;
- }
-
- defined $params{command_creation_chain_methods}
- or $params{command_creation_chain_methods} = $class->_build_command_creation_chain_methods(\%params);
- my @creation_chain = _ARRAY($params{command_creation_chain_methods})
- ? @{$params{command_creation_chain_methods}}
- : ($params{command_creation_chain_methods});
- my $creation_method_name = first { defined $_ and $class->can($_) } @creation_chain;
- croak "Can't find a creation method on " . $class unless $creation_method_name;
- my $creation_method = $class->can($creation_method_name); # XXX this is a perfect candidate for a new function in List::MoreUtils
-
- @ARGV = @used_args;
- $params{command_args} = [ @args ];
- $params{command_name} = $cmd_name;
- defined $params{command_chain} or $params{command_chain} = [];
- my $self = $creation_method->($class, %params);
- push @{$self->command_chain}, $self;
-
- if ($cmd) {
- @ARGV = @args;
- my ($creation_method,$creation_method_name,$cmd_plugin);
- $cmd->can("_build_command_creation_method_name") and $creation_method_name = $cmd->_build_command_creation_method_name(\%params);
- $creation_method_name and $creation_method = $cmd->can($creation_method_name);
- if ($creation_method) {
- @cmd_create_params{qw(command_chain)} = @$self{qw(command_chain)};
- $cmd_plugin = $creation_method->($cmd, %cmd_create_params);
- $self->{$self->command_execute_return_method_name} = [
- @{ $call_indirect_method->($cmd_plugin, "command_execute_return_method_name") } ];
- } else {
- $creation_method_name = first { $cmd->can($_) } @creation_chain;
- croak "Can't find a creation method on " . $cmd unless $creation_method_name;
- # XXX this is a perfect candidate for a new function in List::MoreUtils
- $creation_method = $cmd->can($creation_method_name);
- $cmd_plugin = $creation_method->($cmd);
- push @{$self->command_chain}, $cmd_plugin;
-
- my $cemn = $cmd_plugin->can("command_execute_method_name");
- my $exec_fun = $cemn ? $cemn->() : $self->command_execute_method_name();
- $self->command_execute_from_new
- and $self->{$self->command_execute_return_method_name} = [
- $call_required_method->($cmd_plugin, $exec_fun, \@ARGV, $self->command_chain) ];
- }
- } else {
- $self->command_execute_from_new
- and $self->{$self->command_execute_return_method_name} = [
- $call_indirect_method->($self, "command_execute_method_name", \@ARGV, $self->command_chain) ];
- }
-
- return $self;
-}
-
-
-# XXX should be an r/w attribute - can be renamed on loading ...
-sub execute_return { $_[0]->{execute_return} }
-
-1;
-
-__END__
-
-=pod
-
=head1 NAME
MooX::Cmd::Role - MooX cli app commands do this
-=head1 VERSION
-
-version 0.009
-
=head1 SYNOPSIS
=head2 using role and want behavior as MooX::Cmd
@@ -261,7 +59,7 @@ version 0.009
my $cmd = MyFoo->new_with_cmd;
$cmd->command_chain->[-1]->run();
-=head2 explicitely expression of some implicit stuff
+=head2 explicit expression of some implicit stuff
package MyFoo;
@@ -288,65 +86,282 @@ MooX::Cmd::Role is made for modern, flexible Moo style to tailor cli commands.
ARRAY-REF of args on command line
+=cut
+
+has 'command_args' => ( is => "ro" );
+
=head2 command_chain
ARRAY-REF of commands lead to this instance
+=cut
+
+has 'command_chain' => ( is => "ro" );
+
=head2 command_chain_end
COMMAND accesses the finally detected command in chain
+=cut
+
+has 'command_chain_end' => ( is => "lazy" );
+
+sub _build_command_chain_end { $_[0]->command_chain->[-1] }
+
=head2 command_name
ARRAY-REF the name of the command lead to this command
+=cut
+
+has 'command_name' => ( is => "ro" );
+
=head2 command_commands
HASH-REF names of other commands
+=cut
+
+has 'command_commands' => ( is => "lazy" );
+
+sub _build_command_commands
+{
+ my ( $class, $params ) = @_;
+ defined $params->{command_base} or $params->{command_base} = $class->_build_command_base($params);
+ my $base = $params->{command_base};
+
+ # i have no clue why 'only' and 'except' seems to not fulfill what i need or are bugged in M::P - Getty
+ my @cmd_plugins = grep {
+ my $plug_class = $_;
+ $plug_class =~ s/${base}:://;
+ $plug_class !~ /:/;
+ } Module::Pluggable::Object->new(
+ search_path => $base,
+ require => 0,
+ )->plugins;
+
+ my %cmds;
+
+ for my $cmd_plugin (@cmd_plugins)
+ {
+ $cmds{ _mkcommand( $cmd_plugin, $base ) } = $cmd_plugin;
+ }
+
+ \%cmds;
+}
+
=head2 command_base
STRING base of command plugins
+=cut
+
+has command_base => ( is => "lazy" );
+
+sub _build_command_base
+{
+ my $class = blessed $_[0] || $_[0];
+ return $class . '::Cmd';
+}
+
=head2 command_execute_method_name
STRING name of the method to invoke to execute a command, default "execute"
+=cut
+
+has command_execute_method_name => ( is => "lazy" );
+
+sub _build_command_execute_method_name { "execute" }
+
=head2 command_execute_return_method_name
-STRING I have no clue what that is goood for ...
+STRING I have no clue what that is good for ...
+
+=cut
+
+has command_execute_return_method_name => ( is => "lazy" );
+
+sub _build_command_execute_return_method_name { "execute_return" }
=head2 command_creation_method_name
STRING name of constructor
+=cut
+
+has command_creation_method_name => ( is => "lazy" );
+
+sub _build_command_creation_method_name { "new_with_cmd" }
+
=head2 command_creation_chain_methods
ARRAY-REF names of methods to chain for creating object (from L</command_creation_method_name>)
+=cut
+
+has command_creation_chain_methods => ( is => "lazy" );
+
+sub _build_command_creation_chain_methods { [ 'new_with_options', 'new' ] }
+
=head2 command_execute_from_new
BOOL true when constructor shall invoke L</command_execute_method_name>, false otherwise
+=cut
+
+has command_execute_from_new => ( is => "lazy" );
+
+sub _build_command_execute_from_new { 0 }
+
=head1 METHODS
=head2 new_with_cmd
initializes by searching command line args for commands and invoke them
+=cut
+
+sub new_with_cmd { goto &_initialize_from_cmd; }
+
+sub _mkcommand
+{
+ my ( $package, $base ) = @_;
+ $package =~ s/^${base}:://g;
+ lc($package);
+}
+
+my @private_init_params =
+ qw(command_base command_execute_method_name command_execute_return_method_name command_creation_chain_methods command_execute_method_name);
+
+my $required_method = sub {
+ my ( $tgt, $method ) = @_;
+ $tgt->can($method) or croak( "You need an '$method' in " . ( blessed $tgt || $tgt ) );
+};
+
+my $call_required_method = sub {
+ my ( $tgt, $method, @args ) = @_;
+ my $m = $required_method->( $tgt, $method );
+ return $m->( $tgt, @args );
+};
+
+my $call_optional_method = sub {
+ my ( $tgt, $method, @args ) = @_;
+ my $m = $tgt->can($method) or return;
+ return $m->( $tgt, @args );
+};
+
+my $call_indirect_method = sub {
+ my ( $tgt, $name_getter, @args ) = @_;
+ my $g = $call_required_method->( $tgt, $name_getter );
+ my $m = $required_method->( $tgt, $g );
+ return $m->( $tgt, @args );
+};
+
+sub _initialize_from_cmd
+{
+ my ( $class, %params ) = @_;
+
+ my @args = shellwords( join ' ', map { quotemeta } @ARGV );
+
+ my ( @used_args, $cmd, $cmd_name );
+
+ my %cmd_create_params = %params;
+ delete @cmd_create_params{ qw(command_commands), @private_init_params };
+
+ defined $params{command_commands} or $params{command_commands} = $class->_build_command_commands( \%params );
+ while ( my $arg = shift @args )
+ {
+ push @used_args, $arg and next unless $cmd = $params{command_commands}->{$arg};
+
+ $cmd_name = $arg; # be careful about relics
+ use_module($cmd);
+ defined $cmd_create_params{command_execute_method_name}
+ or $cmd_create_params{command_execute_method_name} =
+ $call_optional_method->( $cmd, "_build_command_execute_method_name", \%cmd_create_params );
+ defined $cmd_create_params{command_execute_method_name}
+ or $cmd_create_params{command_execute_method_name} = "execute";
+ $required_method->( $cmd, $cmd_create_params{command_execute_method_name} );
+ last;
+ }
+
+ defined $params{command_creation_chain_methods}
+ or $params{command_creation_chain_methods} = $class->_build_command_creation_chain_methods( \%params );
+ my @creation_chain =
+ _ARRAY( $params{command_creation_chain_methods} )
+ ? @{ $params{command_creation_chain_methods} }
+ : ( $params{command_creation_chain_methods} );
+ my $creation_method_name = first { defined $_ and $class->can($_) } @creation_chain;
+ croak "Can't find a creation method on " . $class unless $creation_method_name;
+ my $creation_method =
+ $class->can($creation_method_name); # XXX this is a perfect candidate for a new function in List::MoreUtils
+
+ @ARGV = @used_args;
+ $params{command_args} = [@args];
+ $params{command_name} = $cmd_name;
+ defined $params{command_chain} or $params{command_chain} = [];
+ my $self = $creation_method->( $class, %params );
+ push @{ $self->command_chain }, $self;
+
+ if ($cmd)
+ {
+ @ARGV = @args;
+ my ( $creation_method, $creation_method_name, $cmd_plugin );
+ $cmd->can("_build_command_creation_method_name")
+ and $creation_method_name = $cmd->_build_command_creation_method_name( \%params );
+ $creation_method_name and $creation_method = $cmd->can($creation_method_name);
+ if ($creation_method)
+ {
+ @cmd_create_params{qw(command_chain)} = @$self{qw(command_chain)};
+ $cmd_plugin = $creation_method->( $cmd, %cmd_create_params );
+ $self->{ $self->command_execute_return_method_name } =
+ [ @{ $call_indirect_method->( $cmd_plugin, "command_execute_return_method_name" ) } ];
+ }
+ else
+ {
+ $creation_method_name = first { $cmd->can($_) } @creation_chain;
+ croak "Can't find a creation method on " . $cmd unless $creation_method_name;
+ # XXX this is a perfect candidate for a new function in List::MoreUtils
+ $creation_method = $cmd->can($creation_method_name);
+ $cmd_plugin = $creation_method->($cmd);
+ push @{ $self->command_chain }, $cmd_plugin;
+
+ my $cemn = $cmd_plugin->can("command_execute_method_name");
+ my $exec_fun = $cemn ? $cemn->() : $self->command_execute_method_name();
+ $self->command_execute_from_new
+ and $self->{ $self->command_execute_return_method_name } =
+ [ $call_required_method->( $cmd_plugin, $exec_fun, \@ARGV, $self->command_chain ) ];
+ }
+ }
+ else
+ {
+ $self->command_execute_from_new
+ and $self->{ $self->command_execute_return_method_name } =
+ [ $call_indirect_method->( $self, "command_execute_method_name", \@ARGV, $self->command_chain ) ];
+ }
+
+ return $self;
+}
+
=head2 execute_return
returns the content of $self->{execute_return}
-=head1 AUTHOR
+=cut
-Torsten Raudssus <torsten@raudss.us>
+# XXX should be an r/w attribute - can be renamed on loading ...
+sub execute_return { $_[0]->{execute_return} }
+
+=head1 LICENSE AND COPYRIGHT
-=head1 COPYRIGHT AND LICENSE
+Copyright 2012-2013 Torsten Raudssus, Copyright 2013-2014 Jens Rehsack.
-This software is copyright (c) 2013 by Torsten Raudssus.
+This program is free software; you can redistribute it and/or modify it
+under the terms of either: the GNU General Public License as published
+by the Free Software Foundation; or the Artistic License.
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
+See L<http://dev.perl.org/licenses/> for more information.
=cut
+
+1;
@@ -1,12 +1,10 @@
package MooX::Cmd::Tester;
-BEGIN {
- $MooX::Cmd::Tester::AUTHORITY = 'cpan:GETTY';
-}
-# ABSTRACT: MooX cli app commands tester
-$MooX::Cmd::Tester::VERSION = '0.009';
+
use strict;
use warnings;
+our $VERSION = "0.011";
+
require Exporter;
use Test::More import => ['!pass'];
use Package::Stash;
@@ -33,7 +31,7 @@ sub test_cmd
{
my ( $app, $argv ) = @_;
- my $result = _run_with_capture( $app, $argv );
+ my $result = _run_with_capture( $app, $argv );
my $exit_code = defined $result->{error} ? ( ( 0 + $! ) || -1 ) : 0;
$result->{error}
@@ -41,22 +39,25 @@ sub test_cmd
and $exit_code = ${ $result->{error} };
result_class->new(
- {
- exit_code => $exit_code,
- %$result,
- }
- );
+ {
+ exit_code => $exit_code,
+ %$result,
+ }
+ );
}
sub test_cmd_ok
{
my $rv = test_cmd(@_);
- my $test_ident = $rv->app . " => [ " . join( " ", @{$_[1]} ) . " ]";
- ok(!$rv->error, "Everythink ok running cmd $test_ident") or diag($rv->error);
+ my $test_ident = $rv->app . " => [ " . join( " ", @{ $_[1] } ) . " ]";
+ ok( !$rv->error, "Everythink ok running cmd $test_ident" ) or diag( $rv->error );
# no error and cmd means, we're reasonable successful so far
- $rv and !$rv->error and $rv->cmd and $rv->cmd->command_name and
- ok($rv->cmd->command_commands->{$rv->cmd->command_name}, "found command at $test_ident");
+ $rv
+ and !$rv->error
+ and $rv->cmd
+ and $rv->cmd->command_name
+ and ok( $rv->cmd->command_commands->{ $rv->cmd->command_name }, "found command at $test_ident" );
$rv;
}
@@ -82,43 +83,43 @@ sub _run_with_capture
$cmd = ref $app ? $app : $app->new_with_cmd;
ref $app and $app = ref $app;
my $test_ident = "$app => [ " . join( " ", @$argv ) . " ]";
- ok( $cmd->isa($app), "got a '$app' from new_with_cmd" );
- @$argv and defined ($cmd_name = $cmd->command_name) and
- ok( (grep { $_ =~ m/$cmd_name/ } @$argv), "proper cmd name from $test_ident" );
- ok( scalar @{ $cmd->command_chain } <= 1 + scalar @$argv,
- "\$#argv vs. command chain length testing $test_ident" );
- @$argv and ok( $cmd->command_chain_end == $cmd->command_chain->[-1],
- "command_chain_end ok");
- unless($execute_rv = $cmd->execute_return)
- {
- my ($command_execute_from_new, $command_execute_method_name);
- my $cce = $cmd->can("command_chain_end");
- $cce and $cce = $cce->($cmd);
- $cce and $command_execute_from_new = $cce->can("command_execute_from_new");
- $command_execute_from_new and $command_execute_from_new = $command_execute_from_new->($cce);
- $command_execute_from_new or $command_execute_method_name = $cce->can('command_execute_method_name');
- $command_execute_method_name
- and $execute_rv = [ $cce->can($command_execute_method_name->($cce))->($cce) ];
- }
+ ok( $cmd->isa($app), "got a '$app' from new_with_cmd" );
+ @$argv
+ and defined( $cmd_name = $cmd->command_name )
+ and ok( ( grep { $_ =~ m/$cmd_name/ } @$argv ), "proper cmd name from $test_ident" );
+ ok( scalar @{ $cmd->command_chain } <= 1 + scalar @$argv, "\$#argv vs. command chain length testing $test_ident" );
+ @$argv and ok( $cmd->command_chain_end == $cmd->command_chain->[-1], "command_chain_end ok" );
+
+ unless ( $execute_rv = $cmd->execute_return )
+ {
+ my ( $command_execute_from_new, $command_execute_method_name );
+ my $cce = $cmd->can("command_chain_end");
+ $cce and $cce = $cce->($cmd);
+ $cce and $command_execute_from_new = $cce->can("command_execute_from_new");
+ $command_execute_from_new and $command_execute_from_new = $command_execute_from_new->($cce);
+ $command_execute_from_new or $command_execute_method_name = $cce->can('command_execute_method_name');
+ $command_execute_method_name
+ and $execute_rv = [ $cce->can( $command_execute_method_name->($cce) )->($cce) ];
+ }
1;
};
my $error = $ok ? undef : $@;
return {
- app => $app,
- cmd => $cmd,
- stdout => $hub->slot_contents('stdout'),
- stderr => $hub->slot_contents('stderr'),
- output => $hub->combined_contents,
- error => $error,
- execute_rv => $execute_rv,
- };
+ app => $app,
+ cmd => $cmd,
+ stdout => $hub->slot_contents('stdout'),
+ stderr => $hub->slot_contents('stderr'),
+ output => $hub->combined_contents,
+ error => $error,
+ execute_rv => $execute_rv,
+ };
}
{
- package # no-index
- MooX::Cmd::Tester::Result;
+ package # no-index
+ MooX::Cmd::Tester::Result;
sub new
{
@@ -134,8 +135,8 @@ for my $attr (qw(app cmd stdout stderr output error execute_rv exit_code))
}
{
- package # no-index
- MooX::Cmd::Tester::Exited;
+ package # no-index
+ MooX::Cmd::Tester::Exited;
sub throw
{
@@ -146,21 +147,10 @@ for my $attr (qw(app cmd stdout stderr output error execute_rv exit_code))
}
}
-
-1;
-
-__END__
-
-=pod
-
=head1 NAME
MooX::Cmd::Tester - MooX cli app commands tester
-=head1 VERSION
-
-version 0.009
-
=head1 SYNOPSIS
use MooX::Cmd::Tester;
@@ -228,7 +218,7 @@ return values from execute
=head3 exit_code
-0 on sucess, $! when error occured and $! available, -1 otherwise
+0 on success, $! when error occurred and $! available, -1 otherwise
=head2 test_cmd_ok
@@ -239,23 +229,29 @@ command_commands, etc.
Returns the same object C<test_cmd> returns.
-If an error occured, no additional test is done (behavior as C<test_cmd>).
+If an error occurred, no additional test is done (behavior as C<test_cmd>).
+
+=head2 result_class
+
+Builder for result class to use. Returns C<MooX::Cmd::Tester::Result> by
+default.
=head1 ACKNOWLEDGEMENTS
MooX::Cmd::Tester is I<inspired> by L<App::Cmd::Tester> from Ricardo Signes.
-In fact, I resused the entire design and adopt it to the requirements of
+In fact, I reused the entire design and adopt it to the requirements of
MooX::Cmd.
-=head1 AUTHOR
-
-Torsten Raudssus <torsten@raudss.us>
+=head1 LICENSE AND COPYRIGHT
-=head1 COPYRIGHT AND LICENSE
+Copyright 2012-2013 Torsten Raudssus, Copyright 2013-2014 Jens Rehsack.
-This software is copyright (c) 2013 by Torsten Raudssus.
+This program is free software; you can redistribute it and/or modify it
+under the terms of either: the GNU General Public License as published
+by the Free Software Foundation; or the Artistic License.
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
+See L<http://dev.perl.org/licenses/> for more information.
=cut
+
+1;
@@ -1,76 +1,70 @@
package MooX::Cmd;
-BEGIN {
- $MooX::Cmd::AUTHORITY = 'cpan:GETTY';
-}
-# ABSTRACT: Giving an easy Moo style way to make command organized CLI apps
-$MooX::Cmd::VERSION = '0.009';
+
use strict;
use warnings;
+
+our $VERSION = "0.011";
+
use Package::Stash;
-sub import {
- my ( undef, %import_options ) = @_;
- my $caller = caller;
- my @caller_isa;
- { no strict 'refs'; @caller_isa = @{"${caller}::ISA"} };
-
- #don't add this to a role
- #ISA of a role is always empty !
- ## no critic qw/ProhibitStringyEval/
- @caller_isa or return;
-
- my $execute_return_method_name = $import_options{execute_return_method_name};
-
- exists $import_options{execute_from_new} or $import_options{execute_from_new} = 1; # set default until we want other way
-
- my $stash = Package::Stash->new($caller);
- defined $import_options{execute_return_method_name}
- and $stash->add_symbol('&'.$import_options{execute_return_method_name}, sub { shift->{$import_options{execute_return_method_name}} });
- defined $import_options{creation_method_name} or $import_options{creation_method_name} = "new_with_cmd";
- $stash->add_symbol('&'.$import_options{creation_method_name}, sub {
- goto &MooX::Cmd::Role::_initialize_from_cmd;;
- });
-
- my $apply_modifiers = sub {
- $caller->can('_initialize_from_cmd') and return;
- my $with = $caller->can('with');
- $with->('MooX::Cmd::Role');
- };
- $apply_modifiers->();
-
- my %default_modifiers = (
- base => '_build_command_base',
- execute_method_name => '_build_command_execute_method_name',
- execute_return_method_name => '_build_command_execute_return_method_name',
- creation_chain_methods => '_build_command_creation_chain_methods',
- creation_method_name => '_build_command_creation_method_name',
- execute_from_new => '_build_command_execute_from_new',
- );
-
- my $around;
- foreach my $opt_key (keys %default_modifiers) {
- exists $import_options{$opt_key} or next;
- $around or $around = $caller->can('around');
- $around->( $default_modifiers{$opt_key} => sub { $import_options{$opt_key} } );
- }
-
- return;
+sub import
+{
+ my ( undef, %import_options ) = @_;
+ my $caller = caller;
+ my @caller_isa;
+ { no strict 'refs'; @caller_isa = @{"${caller}::ISA"} };
+
+ #don't add this to a role
+ #ISA of a role is always empty !
+ ## no critic qw/ProhibitStringyEval/
+ @caller_isa or return;
+
+ my $execute_return_method_name = $import_options{execute_return_method_name};
+
+ exists $import_options{execute_from_new} or $import_options{execute_from_new} = 1; # set default until we want other way
+
+ my $stash = Package::Stash->new($caller);
+ defined $import_options{execute_return_method_name}
+ and $stash->add_symbol( '&' . $import_options{execute_return_method_name},
+ sub { shift->{ $import_options{execute_return_method_name} } } );
+ defined $import_options{creation_method_name} or $import_options{creation_method_name} = "new_with_cmd";
+ $stash->add_symbol( '&' . $import_options{creation_method_name}, sub { shift->_initialize_from_cmd(@_); } );
+
+ my $apply_modifiers = sub {
+ $caller->can('_initialize_from_cmd') and return;
+ my $with = $caller->can('with');
+ $with->('MooX::Cmd::Role');
+ };
+ $apply_modifiers->();
+
+ my %default_modifiers = (
+ base => '_build_command_base',
+ execute_method_name => '_build_command_execute_method_name',
+ execute_return_method_name => '_build_command_execute_return_method_name',
+ creation_chain_methods => '_build_command_creation_chain_methods',
+ creation_method_name => '_build_command_creation_method_name',
+ execute_from_new => '_build_command_execute_from_new',
+ );
+
+ my $around;
+ foreach my $opt_key ( keys %default_modifiers )
+ {
+ exists $import_options{$opt_key} or next;
+ $around or $around = $caller->can('around');
+ $around->( $default_modifiers{$opt_key} => sub { $import_options{$opt_key} } );
+ }
+
+ return;
}
1;
-__END__
-
-=pod
+=encoding utf8
=head1 NAME
MooX::Cmd - Giving an easy Moo style way to make command organized CLI apps
-=head1 VERSION
-
-version 0.009
-
=head1 SYNOPSIS
package MyApp;
@@ -159,12 +153,221 @@ version 0.009
=head1 DESCRIPTION
-Works together with L<MooX::Options> for every command on its own, so options are
-parsed for the specific context and used for the instantiation:
+Eases the writing of command line utilities, accepting commands and
+subcommands and so on. These commands can form a tree, which is
+mirrored in the package structure. On invocation each command along
+the path through the tree (starting from the toplevel command
+through to the most specific one) is instanciated.
- myapp --argformyapp command --argformyappcmdcommand ...
+Each command needs to have an C<execute> function, accepting three
+parameters:
-=encoding utf8
+=over
+
+=item C<self>
+
+A reference to the specific L<MooX::Cmd> object that is executing.
+
+=item C<args>
+
+An ArrayRef of arguments passed to C<self>. This only encompasses
+arguments of the most specific (read: right-most) command.
+
+=item C<chain>
+
+An ArrayRef of C<MooX::Cmd>s along the tree path, as specified on
+the command line.
+
+=back
+
+B<Note that only the execute function of the most specific command is executed.>
+
+=head3 L<MooX::Cmd> Attributes
+
+Each command has some attributes set by L<MooX::Cmd> during
+initialization:
+
+=over
+
+=item C<command_chain>
+
+Same as C<chain> argument to C<execute>.
+
+=item C<command_name>
+
+TODO
+
+=item C<command_commands>
+
+TODO
+
+=item C<command_args>
+
+TODO
+
+=item C<command_base>
+
+TODO
+
+=back
+
+=head2 Examples
+
+=head3 A Single Toplevel Command
+
+ #!/usr/bin/env perl
+ package MyApp;
+ use Moo;
+ use MooX::Cmd;
+
+ sub execute {
+ my ($self,$args,$chain) = @_;
+ printf("%s.execute(\$self,[%s],[%s])\n",
+ ref($self), # which command is executing?
+ join(", ", @$args ), # what where the arguments?
+ join(", ", map { ref } @$chain) # what's in the command chain?
+ );
+ }
+
+ package main;
+ MyApp->new_with_cmd();
+
+Some sample invocations:
+
+ $ ./MyApp.pl
+ MyApp.execute($self,[],[MyApp])
+
+ $./MyApp.pl --opt1
+ MyApp.execute($self,[--opt1],[MyApp])
+
+ $ ./MyApp.pl --opt1 arg
+ MyApp.execute($self,[--opt1, arg],[MyApp])
+
+=head3 Toplevel Command with Subcommand
+
+ #!/usr/bin/env perl
+ # let's define a base class containing our generic execute
+ # function to save some typing...
+ package CmdBase;
+ use Moo;
+
+ sub execute {
+ my ($self,$args,$chain) = @_;
+ printf("%s.execute(\$self,[%s],[%s])\n",
+ ref($self),
+ join(", ", @$args ),
+ join(", ", map { ref } @$chain)
+ );
+ }
+
+ package MyApp;
+ # toplevel command/app
+ use Moo;
+ use MooX::Cmd;
+ extends 'CmdBase';
+
+ package MyApp::Cmd::frobnicate;
+ # can be called via ./MyApp.pl frobnicate
+ use Moo;
+ use MooX::Cmd;
+ extends 'CmdBase';
+
+ package main;
+ MyApp->new_with_cmd();
+
+And some sample invocations:
+
+ $ ./MyApp.pl frobnicate
+ MyApp::Cmd::frobnicate.execute($self,[],[MyApp, MyApp::Cmd::frobnicate])
+
+As you can see the chain contains our toplevel command object and
+then the specififc one.
+
+ $ ./MyApp.pl frobnicate arg1
+ MyApp::Cmd::frobnicate.execute($self,[arg1],[MyApp, MyApp::Cmd::frobnicate])
+
+Arguments are passed via the C<args> parameter.
+
+ $ ./MyApp.pl some --stuff frobnicate arg1
+ MyApp::Cmd::frobnicate.execute($self,[arg1],[MyApp, MyApp::Cmd::frobnicate])
+
+Arguments to commands higher in the tree get ignored if they don't
+match a command.
+
+=head3 Access Toplevel Attributes via Chain
+
+ #!/usr/bin/env perl
+ package CmdBase;
+ use Moo;
+
+ sub execute {
+ my ($self,$args,$chain) = @_;
+ printf("%s.execute(\$self,[%s],[%s])\n",
+ ref($self),
+ join(", ", @$args ),
+ join(", ", map { ref } @$chain)
+ );
+ }
+
+ package MyApp;
+ use Moo;
+ use MooX::Cmd;
+ extends 'CmdBase';
+
+ has somevar => ( is => 'ro', default => 'someval' );
+
+ package MyApp::Cmd::frobnicate;
+ use Moo;
+ use MooX::Cmd;
+ extends 'CmdBase';
+
+ around execute => sub {
+ my ($orig,$self,$args,$chain) = @_;
+ $self->$orig($args,$chain);
+ # we can access toplevel attributes via the chain...
+ printf("MyApp->somevar = '%s'\n", $chain->[0]->somevar);
+ };
+
+ package main;
+ MyApp->new_with_cmd();
+
+A sample invocation
+
+ $ ./MyApp.pl some --stuff frobnicate arg1
+ MyApp::Cmd::frobnicate.execute($self,[arg1],[MyApp, MyApp::Cmd::frobnicate])
+ MyApp->somevar = someval
+
+
+=head2 L<MooX::Options> integration
+
+You can integrate L<MooX::Options> simply by using it and declaring
+some options, like so:
+
+ #!/usr/bin/env perl
+ package MyApp;
+ use Moo;
+ use MooX::Cmd;
+ use MooX::Options;
+
+ option debug => ( is => 'ro' );
+
+ sub execute {
+ my ($self,$args,$chain) = @_;
+ print "debugging enabled!\n" if $self->{debug};
+ }
+
+ package main;
+ MyApp->new_with_cmd();
+
+A sample invocation
+
+ $ ./MyApp-Options.pl --debug
+ debugging enabled!
+
+B<Note, that each command and subcommand has its own options.>, so options are
+parsed for the specific context and used for the instantiation:
+
+ $ ./MyApp.pl --argformyapp command --argformyappcmdcommand ...
=head1 SUPPORT
@@ -176,6 +379,8 @@ Repository
Issue Tracker
http://github.com/Getty/p5-moox-cmd/issues
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooX-Cmd
+ bug-moox-cmd at rt.cpan.org
=head1 THANKS
@@ -195,15 +400,14 @@ did the initial work and brought it to CPAN
=back
-=head1 AUTHOR
-
-Torsten Raudssus <torsten@raudss.us>
+=head1 LICENSE AND COPYRIGHT
-=head1 COPYRIGHT AND LICENSE
+Copyright 2012-2013 Torsten Raudssus, Copyright 2013-2014 Jens Rehsack.
-This software is copyright (c) 2013 by Torsten Raudssus.
+This program is free software; you can redistribute it and/or modify it
+under the terms of either: the GNU General Public License as published
+by the Free Software Foundation; or the Artistic License.
-This is free software; you can redistribute it and/or modify it under
-the same terms as the Perl 5 programming language system itself.
+See L<http://dev.perl.org/licenses/> for more information.
=cut
@@ -1,16 +0,0 @@
-#!perl
-
-BEGIN {
- unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate testing');
- }
-}
-
-# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests.
-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();