| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::Gnats::Command::QFMT; |
|
2
|
40
|
|
|
40
|
|
199
|
use parent 'Net::Gnats::Command'; |
|
|
40
|
|
|
|
|
70
|
|
|
|
40
|
|
|
|
|
218
|
|
|
3
|
40
|
|
|
40
|
|
2123
|
use strictures; |
|
|
40
|
|
|
|
|
65
|
|
|
|
40
|
|
|
|
|
210
|
|
|
4
|
|
|
|
|
|
|
BEGIN { |
|
5
|
40
|
|
|
40
|
|
8856
|
$Net::Gnats::Command::QFMT::VERSION = '0.22'; |
|
6
|
|
|
|
|
|
|
} |
|
7
|
40
|
|
|
40
|
|
211
|
use vars qw($VERSION); |
|
|
40
|
|
|
|
|
71
|
|
|
|
40
|
|
|
|
|
1648
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
204
|
use Net::Gnats::Constants qw(CODE_OK CODE_CMD_ERROR CODE_INVALID_QUERY_FORMAT); |
|
|
40
|
|
|
|
|
79
|
|
|
|
40
|
|
|
|
|
8999
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::QFMT |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Use the specified query format to format the output of the QUER |
|
18
|
|
|
|
|
|
|
command. The query format may be either the name of a query format |
|
19
|
|
|
|
|
|
|
known to the server (see Named query definitions), or an actual |
|
20
|
|
|
|
|
|
|
query format (see Formatting query-pr output). |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 PROTOCOL |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
QFMT |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 RESPONSES |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
The possible |
|
29
|
|
|
|
|
|
|
responses are: |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
210 (CODE_OK) The normal response, which indicates that the query |
|
32
|
|
|
|
|
|
|
format is acceptable. |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
440 (CODE_CMD_ERROR) No query format was supplied. |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
418 (CODE_INVALID_QUERY_FORMAT) The specified query format does not |
|
37
|
|
|
|
|
|
|
exist, or could not be parsed. |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $c = 'QFMT'; |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub new { |
|
44
|
15
|
|
|
15
|
1
|
45
|
my ( $class, %options ) = @_; |
|
45
|
|
|
|
|
|
|
|
|
46
|
15
|
|
|
|
|
31
|
my $self = bless \%options, $class; |
|
47
|
15
|
|
|
|
|
55
|
return $self; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub as_string { |
|
51
|
29
|
|
|
29
|
1
|
37
|
my $self = shift; |
|
52
|
29
|
100
|
|
|
|
93
|
return undef if not defined $self->{format}; |
|
53
|
28
|
|
|
|
|
112
|
return $c . ' ' . $self->{format}; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub is_ok { |
|
57
|
15
|
|
|
15
|
0
|
26
|
my $self = shift; |
|
58
|
15
|
100
|
|
|
|
49
|
return 0 if not defined $self->response; |
|
59
|
14
|
50
|
|
|
|
42
|
return 1 if $self->response->code == CODE_OK; |
|
60
|
0
|
|
|
|
|
|
return 0; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |