| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::Gnats::Command::QFMT; |
|
2
|
40
|
|
|
40
|
|
165
|
use parent 'Net::Gnats::Command'; |
|
|
40
|
|
|
|
|
50
|
|
|
|
40
|
|
|
|
|
188
|
|
|
3
|
40
|
|
|
40
|
|
2035
|
use strictures; |
|
|
40
|
|
|
|
|
51
|
|
|
|
40
|
|
|
|
|
166
|
|
|
4
|
|
|
|
|
|
|
BEGIN { |
|
5
|
40
|
|
|
40
|
|
2946
|
$Net::Gnats::Command::QFMT::VERSION = '0.20'; |
|
6
|
|
|
|
|
|
|
} |
|
7
|
40
|
|
|
40
|
|
195
|
use vars qw($VERSION); |
|
|
40
|
|
|
|
|
61
|
|
|
|
40
|
|
|
|
|
1796
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
187
|
use Net::Gnats::Constants qw(CODE_OK CODE_CMD_ERROR CODE_INVALID_QUERY_FORMAT); |
|
|
40
|
|
|
|
|
64
|
|
|
|
40
|
|
|
|
|
7590
|
|
|
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
|
14
|
|
|
14
|
1
|
58
|
my ( $class, %options ) = @_; |
|
45
|
|
|
|
|
|
|
|
|
46
|
14
|
|
|
|
|
50
|
my $self = bless \%options, $class; |
|
47
|
14
|
|
|
|
|
48
|
return $self; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub as_string { |
|
51
|
27
|
|
|
27
|
1
|
29
|
my $self = shift; |
|
52
|
27
|
100
|
|
|
|
85
|
return undef if not defined $self->{format}; |
|
53
|
26
|
|
|
|
|
164
|
return $c . ' ' . $self->{format}; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub is_ok { |
|
57
|
14
|
|
|
14
|
0
|
27
|
my $self = shift; |
|
58
|
14
|
100
|
|
|
|
55
|
return 0 if not defined $self->response; |
|
59
|
13
|
50
|
|
|
|
45
|
return 1 if $self->response->code == CODE_OK; |
|
60
|
0
|
|
|
|
|
|
return 0; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |