| 1 | package Boxer::CLI::Command::Aliases; | ||||||||||
| 2 | |||||||||||
| 3 | =encoding UTF-8 | ||||||||||
| 4 | |||||||||||
| 5 | =cut | ||||||||||
| 6 | |||||||||||
| 7 | 3 | ▶ | use v5.20; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 3 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 3 | ▶ | use Role::Commons -all; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 3 | ▶ | use feature 'signatures'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 3 | ▶ | use namespace::autoclean 0.16; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 3 | ▶ | use match::simple qw(match); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 3 | ▶ | use Boxer::CLI -command; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 3 | ▶ | use strictures 2; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 3 | ▶ | no warnings "experimental::signatures"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | =head1 VERSION | ||||||||||
| 20 | |||||||||||
| 21 | Version v1.4.3 | ||||||||||
| 22 | |||||||||||
| 23 | =cut | ||||||||||
| 24 | |||||||||||
| 25 | 3 | our $VERSION = "v1.4.3"; | |||||||||
| 26 | |||||||||||
| 27 | 3 | ▶ | use constant { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | 3 | abstract => q[show aliases for boxer commands], | |||||||||
| 29 | usage_desc => q[%c aliases], | ||||||||||
| 30 | 3 | }; | |||||||||
| 31 | |||||||||||
| 32 | sub description | ||||||||||
| 33 | 0 | ▶ | { | ||||||||
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 34 | 0 | <<'DESCRIPTION'; | |||||||||
| 35 | Some boxer commands can be invoked with shorter aliases. | ||||||||||
| 36 | |||||||||||
| 37 | boxer version | ||||||||||
| 38 | boxer --version # same thing | ||||||||||
| 39 | |||||||||||
| 40 | The aliases command (which, ironically, has no shorter alias) shows existing | ||||||||||
| 41 | aliases. | ||||||||||
| 42 | DESCRIPTION | ||||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | sub command_names | ||||||||||
| 46 | 5 | ▶ | { | ||||||||
|
Subroutine
command_names: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 47 | 5 | qw( | |||||||||
| 48 | aliases | ||||||||||
| 49 | ); | ||||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | sub opt_spec | ||||||||||
| 53 | 0 | ▶ | { | ||||||||
|
Subroutine
opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 54 | 0 | return; | |||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | 0 | ▶ | sub execute ( $self, $opt, $args ) | ||||||||
|
Subroutine
execute: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 58 | { | ||||||||||
| 59 | my $filter | ||||||||||
| 60 | = scalar(@$args) | ||||||||||
| 61 | ? $args | ||||||||||
| 62 | 0 | ▶ | : sub { not( match( shift, [qw(aliases commands help)] ) ) }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||
| 63 | |||||||||||
| 64 | 0 | foreach my $cmd ( sort $self->app->command_plugins ) { | |||||||||
| 65 | 0 | my ( $preferred, @aliases ) = $cmd->command_names; | |||||||||
| 66 | 0 | ▶ | printf( "%-16s: %s\n", $preferred, "@aliases" ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 67 | if match( $preferred, $filter ); | ||||||||||
| 68 | } | ||||||||||
| 69 | } | ||||||||||
| 70 | |||||||||||
| 71 | =head1 AUTHOR | ||||||||||
| 72 | |||||||||||
| 73 | Jonas Smedegaard C<< <dr@jones.dk> >>. | ||||||||||
| 74 | |||||||||||
| 75 | =cut | ||||||||||
| 76 | |||||||||||
| 77 | 3 | our $AUTHORITY = 'cpan:JONASS'; | |||||||||
| 78 | |||||||||||
| 79 | =head1 COPYRIGHT AND LICENCE | ||||||||||
| 80 | |||||||||||
| 81 | Copyright © 2013-2016 Jonas Smedegaard | ||||||||||
| 82 | |||||||||||
| 83 | This is free software; you can redistribute it and/or modify it under | ||||||||||
| 84 | the same terms as the Perl 5 programming language system itself. | ||||||||||
| 85 | |||||||||||
| 86 | =head1 DISCLAIMER OF WARRANTIES | ||||||||||
| 87 | |||||||||||
| 88 | THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED | ||||||||||
| 89 | WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | ||||||||||
| 90 | MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||||||||||
| 91 | |||||||||||
| 92 | =cut | ||||||||||
| 93 | |||||||||||
| 94 | 3 | 1; | |||||||||