r43074 - in /branches/upstream/libapp-cmd-perl/current: ./ lib/App/ lib/App/Cmd/ lib/App/Cmd/Command/ lib/App/Cmd/Subdispatch/ t/ t/lib/Test/ t/lib/Test/MyCmdAbbrev/ t/lib/Test/MyCmdAbbrev/Command/

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Fri Aug 28 01:23:56 UTC 2009


Author: ryan52-guest
Date: Fri Aug 28 01:23:45 2009
New Revision: 43074

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=43074
Log:
[svn-upgrade] Integrating new upstream version, libapp-cmd-perl (0.207)

Added:
    branches/upstream/libapp-cmd-perl/current/t/abbrev.t
    branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/
    branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev.pm
    branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/
    branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/bar.pm
    branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/baz.pm
    branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/foo.pm
Modified:
    branches/upstream/libapp-cmd-perl/current/Changes
    branches/upstream/libapp-cmd-perl/current/MANIFEST
    branches/upstream/libapp-cmd-perl/current/META.yml
    branches/upstream/libapp-cmd-perl/current/lib/App/Cmd.pm
    branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/ArgProcessor.pm
    branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command.pm
    branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/commands.pm
    branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/help.pm
    branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Simple.pm
    branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch.pm
    branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch/DashedStyle.pm
    branches/upstream/libapp-cmd-perl/current/t/00-load.t
    branches/upstream/libapp-cmd-perl/current/t/basic.t
    branches/upstream/libapp-cmd-perl/current/t/simple-require.t
    branches/upstream/libapp-cmd-perl/current/t/simple-use.t

Modified: branches/upstream/libapp-cmd-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/Changes?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/Changes (original)
+++ branches/upstream/libapp-cmd-perl/current/Changes Fri Aug 28 01:23:45 2009
@@ -1,7 +1,11 @@
 Revision history for App-Cmd
 
+0.207     2009-09-27
+          add option to allow any unambiguous command abbreviation
+          (thanks, Jerome Quelin)
+
 0.206     2009-08-19
-          add a ->description to commands (thanks Jerome Quelin)
+          add a ->description to commands (thanks, Jerome Quelin)
 
 0.205     2009-08-18
           add the long-missing arg0 and full_arg0 accessors (resolves 35528)

Modified: branches/upstream/libapp-cmd-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/MANIFEST?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/MANIFEST (original)
+++ branches/upstream/libapp-cmd-perl/current/MANIFEST Fri Aug 28 01:23:45 2009
@@ -27,6 +27,7 @@
 META.yml
 README
 t/00-load.t
+t/abbrev.t
 t/basic.t
 t/lib/Test/MyCmd.pm
 t/lib/Test/MyCmd/Command/frobulate.pm
@@ -35,6 +36,10 @@
 t/lib/Test/MyCmd2.pm
 t/lib/Test/MyCmd2/Command/foo.pm
 t/lib/Test/MyCmd2/Command/foo/bar.pm
+t/lib/Test/MyCmdAbbrev.pm
+t/lib/Test/MyCmdAbbrev/Command/bar.pm
+t/lib/Test/MyCmdAbbrev/Command/baz.pm
+t/lib/Test/MyCmdAbbrev/Command/foo.pm
 t/lib/Test/MySimple.pm
 t/lib/Test/WithSetup.pm
 t/lib/Test/WithSetup/Command.pm

Modified: branches/upstream/libapp-cmd-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/META.yml?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/META.yml (original)
+++ branches/upstream/libapp-cmd-perl/current/META.yml Fri Aug 28 01:23:45 2009
@@ -29,4 +29,4 @@
 resources:
   license: http://dev.perl.org/licenses/
   repository: http://github.com/rjbs/app-cmd
-version: 0.206
+version: 0.207

Modified: branches/upstream/libapp-cmd-perl/current/lib/App/Cmd.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/lib/App/Cmd.pm?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/lib/App/Cmd.pm (original)
+++ branches/upstream/libapp-cmd-perl/current/lib/App/Cmd.pm Fri Aug 28 01:23:45 2009
@@ -8,6 +8,7 @@
 
 use File::Basename ();
 use Module::Pluggable::Object ();
+use Text::Abbrev;
 
 use Sub::Exporter -setup => {
   collectors => {
@@ -47,11 +48,11 @@
 
 =head1 VERSION
 
-version 0.206
-
-=cut
-
-our $VERSION = '0.206';
+version 0.207
+
+=cut
+
+our $VERSION = '0.207';
 
 =head1 SYNOPSIS
 
@@ -175,6 +176,12 @@
   }
 
   $self->_load_default_plugin($_, $arg, \%plugin) for qw(commands help);
+
+  if ($self->allow_any_unambiguous_abbrev) {
+    # add abbreviations to list of authorized commands
+    my %abbrev = abbrev keys %plugin;
+    @plugin{ keys %abbrev } = @plugin{ values %abbrev };
+  }
 
   return \%plugin;
 }
@@ -405,6 +412,23 @@
   }
 }
 
+=head2 allow_any_unambiguous_abbrev
+
+If this method returns true (which, by default, it does I<not>), then any
+unambiguous abbreviation for a registered command name will be allowed as a
+means to use that command.  For example, given the following commands:
+
+  reticulate
+  reload
+  rasterize
+
+Then the user could use C<ret> for C<reticulate> or C<ra> for C<rasterize> and
+so on.
+
+=cut
+
+sub allow_any_unambiguous_abbrev { return 0 }
+
 =head2 global_options
 
   if ($cmd->app->global_options->{verbose}) { ... }

Modified: branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/ArgProcessor.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/ArgProcessor.pm?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/ArgProcessor.pm (original)
+++ branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/ArgProcessor.pm Fri Aug 28 01:23:45 2009
@@ -9,11 +9,11 @@
 
 =head1 VERSION
 
-version 0.206
+version 0.207
 
 =cut
 
-our $VERSION = '0.206';
+our $VERSION = '0.207';
 
 sub _process_args {
   my ($class, $args, @params) = @_;

Modified: branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command.pm?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command.pm (original)
+++ branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command.pm Fri Aug 28 01:23:45 2009
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-version 0.206
-
-=cut
-
-our $VERSION = '0.206';
+version 0.207
+
+=cut
+
+our $VERSION = '0.207';
 
 use Carp ();
 

Modified: branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/commands.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/commands.pm?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/commands.pm (original)
+++ branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/commands.pm Fri Aug 28 01:23:45 2009
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-version 0.206
+version 0.207
 
 =cut
 
-our $VERSION = 0.206;
+our $VERSION = 0.207;
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/help.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/help.pm?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/help.pm (original)
+++ branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Command/help.pm Fri Aug 28 01:23:45 2009
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-version 0.206
+version 0.207
 
 =cut
 
-our $VERSION = '0.206';
+our $VERSION = '0.207';
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Simple.pm?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Simple.pm (original)
+++ branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Simple.pm Fri Aug 28 01:23:45 2009
@@ -5,7 +5,7 @@
 use App::Cmd::Command;
 BEGIN { our @ISA = 'App::Cmd::Command' }
 
-our $VERSION = '0.206';
+our $VERSION = '0.207';
 
 use App::Cmd;
 use Sub::Install;

Modified: branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch.pm?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch.pm (original)
+++ branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch.pm Fri Aug 28 01:23:45 2009
@@ -13,11 +13,11 @@
 
 =head1 VERSION
 
-version 0.206
+version 0.207
 
 =cut
 
-our $VERSION = '0.206';
+our $VERSION = '0.207';
 
 =head1 METHODS
 

Modified: branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch/DashedStyle.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch/DashedStyle.pm?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch/DashedStyle.pm (original)
+++ branches/upstream/libapp-cmd-perl/current/lib/App/Cmd/Subdispatch/DashedStyle.pm Fri Aug 28 01:23:45 2009
@@ -11,11 +11,11 @@
 
 =head1 VERSION
 
-version 0.206
+version 0.207
 
 =cut
 
-our $VERSION = '0.206';
+our $VERSION = '0.207';
 
 =head1 METHODS
 

Modified: branches/upstream/libapp-cmd-perl/current/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/00-load.t?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/00-load.t (original)
+++ branches/upstream/libapp-cmd-perl/current/t/00-load.t Fri Aug 28 01:23:45 2009
@@ -1,4 +1,4 @@
-#!perl -T
+#!perl
 
 use Test::More tests => 5;
 

Added: branches/upstream/libapp-cmd-perl/current/t/abbrev.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/abbrev.t?rev=43074&op=file
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/abbrev.t (added)
+++ branches/upstream/libapp-cmd-perl/current/t/abbrev.t Fri Aug 28 01:23:45 2009
@@ -1,0 +1,22 @@
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+use App::Cmd::Tester;
+
+use lib 't/lib';
+
+use Test::MyCmdAbbrev;
+
+my $app = Test::MyCmdAbbrev->new( {
+    no_commands_plugin => 1,
+    no_help_plugin     => 1,
+} );
+
+is_deeply(
+    [ sort $app->command_names ],
+    [ sort qw{ foo fo f bar baz } ],
+    "got correct list of abbreviated registered command names",
+);

Modified: branches/upstream/libapp-cmd-perl/current/t/basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/basic.t?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/basic.t (original)
+++ branches/upstream/libapp-cmd-perl/current/t/basic.t Fri Aug 28 01:23:45 2009
@@ -1,4 +1,4 @@
-#!perl -T
+#!perl
 
 use strict;
 use warnings;

Added: branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev.pm?rev=43074&op=file
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev.pm (added)
+++ branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev.pm Fri Aug 28 01:23:45 2009
@@ -1,0 +1,10 @@
+package Test::MyCmdAbbrev;
+
+use strict;
+use warnings;
+
+use base qw{ App::Cmd };
+
+sub allow_any_unambiguous_abbrev { 1 }
+
+1;

Added: branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/bar.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/bar.pm?rev=43074&op=file
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/bar.pm (added)
+++ branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/bar.pm Fri Aug 28 01:23:45 2009
@@ -1,0 +1,8 @@
+package Test::MyCmdAbbrev::Command::bar;
+
+use strict;
+use warnings;
+
+use base qw{ App::Cmd::Command };
+
+1;

Added: branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/baz.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/baz.pm?rev=43074&op=file
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/baz.pm (added)
+++ branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/baz.pm Fri Aug 28 01:23:45 2009
@@ -1,0 +1,8 @@
+package Test::MyCmdAbbrev::Command::baz;
+
+use strict;
+use warnings;
+
+use base qw{ App::Cmd::Command };
+
+1;

Added: branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/foo.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/foo.pm?rev=43074&op=file
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/foo.pm (added)
+++ branches/upstream/libapp-cmd-perl/current/t/lib/Test/MyCmdAbbrev/Command/foo.pm Fri Aug 28 01:23:45 2009
@@ -1,0 +1,8 @@
+package Test::MyCmdAbbrev::Command::foo;
+
+use strict;
+use warnings;
+
+use base qw{ App::Cmd::Command };
+
+1;

Modified: branches/upstream/libapp-cmd-perl/current/t/simple-require.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/simple-require.t?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/simple-require.t (original)
+++ branches/upstream/libapp-cmd-perl/current/t/simple-require.t Fri Aug 28 01:23:45 2009
@@ -1,4 +1,4 @@
-#!perl -T
+#!perl
 use strict;
 use warnings;
 

Modified: branches/upstream/libapp-cmd-perl/current/t/simple-use.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-cmd-perl/current/t/simple-use.t?rev=43074&op=diff
==============================================================================
--- branches/upstream/libapp-cmd-perl/current/t/simple-use.t (original)
+++ branches/upstream/libapp-cmd-perl/current/t/simple-use.t Fri Aug 28 01:23:45 2009
@@ -1,4 +1,4 @@
-#!perl -T
+#!perl
 use strict;
 use warnings;
 




More information about the Pkg-perl-cvs-commits mailing list