line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ============================================================================ |
2
|
|
|
|
|
|
|
package MooseX::App::Plugin::Typo; |
3
|
|
|
|
|
|
|
# ============================================================================ |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
2143
|
use 5.010; |
|
1
|
|
|
|
|
3
|
|
6
|
1
|
|
|
1
|
|
3
|
use utf8; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
18
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
9
|
1
|
|
|
1
|
|
61
|
use Moose::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub plugin_metaroles { |
12
|
0
|
|
|
0
|
0
|
|
my ($self,$class) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
return { |
15
|
0
|
|
|
|
|
|
class => ['MooseX::App::Plugin::Typo::Meta::Class'], |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
1; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
__END__ |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=encoding utf8 |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
MooseX::App::Plugin::Typo - Handle typos in command names |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
In your base class: |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
package MyApp; |
34
|
|
|
|
|
|
|
use MooseX::App qw(Typo); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
In your shell |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
bash$ myapp pusl |
39
|
|
|
|
|
|
|
Ambiguous command 'pusl' |
40
|
|
|
|
|
|
|
Which command did you mean? |
41
|
|
|
|
|
|
|
* push |
42
|
|
|
|
|
|
|
* pull |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This plugin tries to handle typos in command names |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |