blib/lib/Mojolicious/Command/get.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
branch | 29 | 50 | 58.0 |
line | true | false | branch |
---|---|---|---|
22 | 4 | 0 | !-t(STDIN) && select($r, undef, undef, 0) ? : |
30 | 1 | 0 | if $_[1] =~ /^(.+)=(\@?)(.+)$/u |
38 | 1 | 3 | unless getopt(\@args, "C|charset=s", \my $charset, "c|content=s", \$in, "f|form=s", sub { _form(\%form) if $_[1] =~ /^(.+)=(\@?)(.+)$/u; } , "H|header=s", \my @headers, "i|inactivity-timeout=i", sub { $ua->inactivity_timeout($_[1]); } , "k|insecure", sub { $ua->insecure(1); } , "M|method=s", \(my $method = "GET"), "o|connect-timeout=i", sub { $ua->connect_timeout($_[1]); } , "r|redirect", \my $redirect, "S|response-size=i", sub { $ua->max_response_size($_[1]); } , "u|user=s", \my $user, "v|verbose", \my $verbose) |
42 | 0 | 3 | unless my $url = shift @args |
46 | 1 | 0 | /^\s*([^:]+)\s*:\s*(.*+)$/u ? : |
49 | 0 | 3 | !($url =~ m[^/]u) ? : |
50 | 0 | 3 | if $user |
51 | 0 | 3 | if $redirect |
60 | 0 | 3 | if $verbose |
65 | 0 | 3 | if $redirect and $tx->res->is_redirect |
66 | 2 | 1 | defined $selector ? : |
73 | 0 | 3 | if $method eq "HEAD" |
75 | 2 | 0 | defined $in ? : |
1 | 2 | %form ? : | |
80 | 1 | 2 | unless defined $selector |
81 | 1 | 1 | if not length $selector or $selector =~ m[^/]u |
88 | 0 | 1 | $2 ? : |
93 | 0 | 1 | unless my $data = j(shift()) |
94 | 0 | 1 | unless defined($data = "Mojo::JSON::Pointer"->new($data)->get(shift())) |
95 | 0 | 1 | ref $data eq 'HASH' || ref $data eq 'ARRAY' ? : |
104 | 1 | 0 | if $charset |
111 | 1 | 1 | if $command =~ /^\d+$/u |
114 | 1 | 0 | if $command eq "text" |
117 | 0 | 0 | if $command eq "all" |
120 | 0 | 0 | if $command eq "attr" |