| 1 | package App::perlrdf::Command::Aliases; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | $App::perlrdf::Command::Aliases::AUTHORITY = 'cpan:TOBYINK'; | |||||||||
| 10 | 1 | $App::perlrdf::Command::Aliases::VERSION = '0.006'; | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | 1 | ▶ | use App::perlrdf -command; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 1 | ▶ | use match::simple qw(match); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | 1 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | 1 | ▶ | use constant { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 1 | abstract => q[show aliases for perlrdf commands], | |||||||||
| 19 | usage_desc => q[%c aliases], | ||||||||||
| 20 | 1 | }; | |||||||||
| 21 | |||||||||||
| 22 | sub description | ||||||||||
| 23 | 0 | ▶ | { | ||||||||
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 24 | <<'DESCRIPTION' | ||||||||||
| 25 | Most perlrdf commands can be invoked with shorter aliases. | ||||||||||
| 26 | |||||||||||
| 27 | perlrdf translate -s rdfxml input.ttl | ||||||||||
| 28 | perlrdf tr -s rdfxml input.ttl # same thing | ||||||||||
| 29 | |||||||||||
| 30 | The aliases command (which, ironically, has no shorter alias) shows existing | ||||||||||
| 31 | aliases. | ||||||||||
| 32 | DESCRIPTION | ||||||||||
| 33 | 0 | } | |||||||||
| 34 | |||||||||||
| 35 | sub command_names | ||||||||||
| 36 | 1 | ▶ | { | ||||||||
|
Subroutine
command_names: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 37 | 1 | qw( | |||||||||
| 38 | aliases | ||||||||||
| 39 | ); | ||||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | sub opt_spec | ||||||||||
| 43 | 0 | ▶ | { | ||||||||
|
Subroutine
opt_spec: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 44 | 0 | return; | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | sub execute | ||||||||||
| 48 | 0 | ▶ | { | ||||||||
|
Subroutine
execute: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 49 | 0 | my ($self, $opt, $args) = @_; | |||||||||
| 50 | |||||||||||
| 51 | my $filter = scalar(@$args) | ||||||||||
| 52 | ? $args | ||||||||||
| 53 | 0 | ▶ | : sub { not match($_[0], [qw(aliases commands help)]) }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||
| 54 | |||||||||||
| 55 | 0 | foreach my $cmd (sort $self->app->command_plugins) | |||||||||
| 56 | { | ||||||||||
| 57 | 0 | my ($preferred, @aliases) = $cmd->command_names; | |||||||||
| 58 | 0 | ▶ | printf("%-16s: %s\n", $preferred, "@aliases") | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | if match($preferred, $filter); | ||||||||||
| 60 | } | ||||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 1 | 1; | |||||||||