line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Util::Endpoint::endpoints; |
2
|
1
|
|
|
1
|
|
845
|
use Mojo::Base 'Mojolicious::Command'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
275
|
use Getopt::Long qw/GetOptions :config no_auto_abbrev no_ignore_case/; |
|
1
|
|
|
|
|
12
|
|
|
1
|
|
|
|
|
8
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has description => "Show available endpoints.\n"; |
7
|
|
|
|
|
|
|
has usage => <<"EOF"; |
8
|
|
|
|
|
|
|
usage: $0 endpoints |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
perl app.pl endpoints |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
EOF |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Run endpoints |
16
|
|
|
|
|
|
|
sub run { |
17
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Options |
20
|
0
|
|
|
|
|
|
local @ARGV = @_; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $c = $self->app->build_controller; |
23
|
0
|
|
|
|
|
|
$c->app($self->app); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# Get endpoints |
26
|
0
|
|
|
|
|
|
my $endpoints = $c->get_endpoints; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# No endpoints |
29
|
0
|
0
|
|
|
|
|
return unless $endpoints; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Print all endpoints |
32
|
0
|
|
|
|
|
|
foreach my $name (sort { $a cmp $b } keys %$endpoints) { |
|
0
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
printf " %-20s %s\n", qq{"$name"}, $endpoints->{$name}; |
34
|
|
|
|
|
|
|
}; |
35
|
0
|
|
|
|
|
|
print "\n"; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return; |
38
|
|
|
|
|
|
|
}; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |