| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::Gnats::Command::FDSC; |
|
2
|
40
|
|
|
40
|
|
166
|
use parent 'Net::Gnats::Command'; |
|
|
40
|
|
|
|
|
50
|
|
|
|
40
|
|
|
|
|
178
|
|
|
3
|
40
|
|
|
40
|
|
2053
|
use strictures; |
|
|
40
|
|
|
|
|
51
|
|
|
|
40
|
|
|
|
|
175
|
|
|
4
|
|
|
|
|
|
|
BEGIN { |
|
5
|
40
|
|
|
40
|
|
3163
|
$Net::Gnats::Command::FDSC::VERSION = '0.20'; |
|
6
|
|
|
|
|
|
|
} |
|
7
|
40
|
|
|
40
|
|
189
|
use vars qw($VERSION); |
|
|
40
|
|
|
|
|
108
|
|
|
|
40
|
|
|
|
|
1532
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
188
|
use Net::Gnats::Constants qw(CODE_INFORMATION CODE_INVALID_FIELD_NAME); |
|
|
40
|
|
|
|
|
54
|
|
|
|
40
|
|
|
|
|
11201
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::FDSC |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Returns a human-readable description of the listed field(s). The possible responses are: |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
Like the FVLD command, the standard continuation protocol will be |
|
20
|
|
|
|
|
|
|
used if multiple fields were specified with the command. |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 PROTOCOL |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
FDSC [fields...] |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 RESPONSES |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
350 (CODE_INFORMATION) |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
The normal response; the supplied text is the field description. |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
410 (CODE_INVALID_FIELD_NAME) |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
The specified field does not exist. |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
my $c = 'FDSC'; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub new { |
|
41
|
41
|
|
|
41
|
1
|
128
|
my ( $class, %options ) = @_; |
|
42
|
41
|
|
|
|
|
122
|
my $self = bless \%options, $class; |
|
43
|
41
|
|
|
|
|
213
|
$self->{requests_multi} = 0; |
|
44
|
41
|
100
|
|
|
|
160
|
return $self if not defined $self->{fields}; |
|
45
|
40
|
50
|
|
|
|
175
|
if (ref $self->{fields} eq 'ARRAY') { |
|
46
|
40
|
100
|
|
|
|
73
|
$self->{requests_multi} = 1 if scalar @{ $self->{fields} } > 1; |
|
|
40
|
|
|
|
|
201
|
|
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
else { |
|
49
|
0
|
|
|
|
|
0
|
$self->{fields} = [ $self->{fields} ]; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
40
|
|
|
|
|
345
|
return $self; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub as_string { |
|
55
|
88
|
|
|
88
|
1
|
1262
|
my ($self) = @_; |
|
56
|
88
|
100
|
|
|
|
276
|
return undef if not defined $self->{fields}; |
|
57
|
86
|
50
|
|
|
|
291
|
return undef if ref $self->{fields} ne 'ARRAY'; |
|
58
|
86
|
50
|
|
|
|
101
|
return undef if scalar @{ $self->{fields} } == 0; |
|
|
86
|
|
|
|
|
230
|
|
|
59
|
86
|
|
|
|
|
176
|
return $c . ' ' . join ( ' ', @{$self->{fields}} ); |
|
|
86
|
|
|
|
|
585
|
|
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
# this command can take multiple fields, each getting their own response. |
|
63
|
|
|
|
|
|
|
# so, we check that 'everything' is okay by looking at the parent response. |
|
64
|
|
|
|
|
|
|
sub is_ok { |
|
65
|
3
|
|
|
3
|
0
|
5
|
my $self = shift; |
|
66
|
3
|
100
|
|
|
|
5
|
return 0 if not defined $self->response; |
|
67
|
2
|
100
|
66
|
|
|
11
|
if ( $self->{requests_multi} == 0 and |
|
68
|
|
|
|
|
|
|
$self->response->code == CODE_INFORMATION) { |
|
69
|
1
|
|
|
|
|
4
|
return 1; |
|
70
|
|
|
|
|
|
|
} |
|
71
|
1
|
50
|
|
|
|
2
|
return 1 if $self->response->code == CODE_INFORMATION; |
|
72
|
0
|
|
|
|
|
|
return 0; |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |