line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command; |
2
|
40
|
|
|
40
|
|
16065
|
use utf8; |
|
40
|
|
|
|
|
63
|
|
|
40
|
|
|
|
|
287
|
|
3
|
40
|
|
|
40
|
|
1663
|
use strictures; |
|
40
|
|
|
|
|
650
|
|
|
40
|
|
|
|
|
220
|
|
4
|
40
|
|
|
40
|
|
3035
|
use Scalar::Util 'reftype'; |
|
40
|
|
|
|
|
56
|
|
|
40
|
|
|
|
|
2596
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
BEGIN { |
7
|
40
|
|
|
40
|
|
688
|
$Net::Gnats::Command::VERSION = '0.20'; |
8
|
|
|
|
|
|
|
} |
9
|
40
|
|
|
40
|
|
185
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
741
|
|
|
40
|
|
|
|
|
2517
|
|
10
|
|
|
|
|
|
|
|
11
|
40
|
|
|
40
|
|
15516
|
use Net::Gnats::Response; |
|
40
|
|
|
|
|
68
|
|
|
40
|
|
|
|
|
1407
|
|
12
|
40
|
|
|
40
|
|
16086
|
use Net::Gnats::Command::ADMV; |
|
40
|
|
|
|
|
81
|
|
|
40
|
|
|
|
|
1298
|
|
13
|
40
|
|
|
40
|
|
16342
|
use Net::Gnats::Command::APPN; |
|
40
|
|
|
|
|
72
|
|
|
40
|
|
|
|
|
1259
|
|
14
|
40
|
|
|
40
|
|
14778
|
use Net::Gnats::Command::CHDB; |
|
40
|
|
|
|
|
73
|
|
|
40
|
|
|
|
|
1194
|
|
15
|
40
|
|
|
40
|
|
15018
|
use Net::Gnats::Command::CHEK; |
|
40
|
|
|
|
|
1009
|
|
|
40
|
|
|
|
|
1290
|
|
16
|
40
|
|
|
40
|
|
15595
|
use Net::Gnats::Command::DBLS; |
|
40
|
|
|
|
|
70
|
|
|
40
|
|
|
|
|
1272
|
|
17
|
40
|
|
|
40
|
|
14684
|
use Net::Gnats::Command::DBDESC; |
|
40
|
|
|
|
|
69
|
|
|
40
|
|
|
|
|
1196
|
|
18
|
40
|
|
|
40
|
|
14368
|
use Net::Gnats::Command::DELETE; |
|
40
|
|
|
|
|
74
|
|
|
40
|
|
|
|
|
1281
|
|
19
|
40
|
|
|
40
|
|
14846
|
use Net::Gnats::Command::EDIT; |
|
40
|
|
|
|
|
76
|
|
|
40
|
|
|
|
|
1289
|
|
20
|
40
|
|
|
40
|
|
14411
|
use Net::Gnats::Command::EDITADDR; |
|
40
|
|
|
|
|
78
|
|
|
40
|
|
|
|
|
1410
|
|
21
|
40
|
|
|
40
|
|
14597
|
use Net::Gnats::Command::EXPR; |
|
40
|
|
|
|
|
107
|
|
|
40
|
|
|
|
|
1352
|
|
22
|
40
|
|
|
40
|
|
14525
|
use Net::Gnats::Command::FDSC; |
|
40
|
|
|
|
|
73
|
|
|
40
|
|
|
|
|
1423
|
|
23
|
40
|
|
|
40
|
|
14368
|
use Net::Gnats::Command::FIELDFLAGS; |
|
40
|
|
|
|
|
82
|
|
|
40
|
|
|
|
|
1405
|
|
24
|
40
|
|
|
40
|
|
13938
|
use Net::Gnats::Command::FTYP; |
|
40
|
|
|
|
|
75
|
|
|
40
|
|
|
|
|
1509
|
|
25
|
40
|
|
|
40
|
|
14442
|
use Net::Gnats::Command::FTYPINFO; |
|
40
|
|
|
|
|
77
|
|
|
40
|
|
|
|
|
1630
|
|
26
|
40
|
|
|
40
|
|
14194
|
use Net::Gnats::Command::FVLD; |
|
40
|
|
|
|
|
89
|
|
|
40
|
|
|
|
|
1519
|
|
27
|
40
|
|
|
40
|
|
14578
|
use Net::Gnats::Command::INPUTDEFAULT; |
|
40
|
|
|
|
|
76
|
|
|
40
|
|
|
|
|
1539
|
|
28
|
40
|
|
|
40
|
|
14178
|
use Net::Gnats::Command::LIST; |
|
40
|
|
|
|
|
78
|
|
|
40
|
|
|
|
|
1735
|
|
29
|
40
|
|
|
40
|
|
14677
|
use Net::Gnats::Command::LKDB; |
|
40
|
|
|
|
|
78
|
|
|
40
|
|
|
|
|
1555
|
|
30
|
40
|
|
|
40
|
|
14239
|
use Net::Gnats::Command::LOCK; |
|
40
|
|
|
|
|
66
|
|
|
40
|
|
|
|
|
1580
|
|
31
|
40
|
|
|
40
|
|
14344
|
use Net::Gnats::Command::QFMT; |
|
40
|
|
|
|
|
76
|
|
|
40
|
|
|
|
|
1775
|
|
32
|
40
|
|
|
40
|
|
14995
|
use Net::Gnats::Command::QUER; |
|
40
|
|
|
|
|
81
|
|
|
40
|
|
|
|
|
1706
|
|
33
|
40
|
|
|
40
|
|
14464
|
use Net::Gnats::Command::REPL; |
|
40
|
|
|
|
|
153
|
|
|
40
|
|
|
|
|
1843
|
|
34
|
40
|
|
|
40
|
|
14596
|
use Net::Gnats::Command::RSET; |
|
40
|
|
|
|
|
73
|
|
|
40
|
|
|
|
|
1682
|
|
35
|
40
|
|
|
40
|
|
14574
|
use Net::Gnats::Command::SUBM; |
|
40
|
|
|
|
|
84
|
|
|
40
|
|
|
|
|
1738
|
|
36
|
40
|
|
|
40
|
|
14030
|
use Net::Gnats::Command::UNDB; |
|
40
|
|
|
|
|
72
|
|
|
40
|
|
|
|
|
1733
|
|
37
|
40
|
|
|
40
|
|
14270
|
use Net::Gnats::Command::UNLK; |
|
40
|
|
|
|
|
94
|
|
|
40
|
|
|
|
|
1792
|
|
38
|
40
|
|
|
40
|
|
14938
|
use Net::Gnats::Command::USER; |
|
40
|
|
|
|
|
82
|
|
|
40
|
|
|
|
|
1891
|
|
39
|
40
|
|
|
40
|
|
14882
|
use Net::Gnats::Command::VFLD; |
|
40
|
|
|
|
|
77
|
|
|
40
|
|
|
|
|
1860
|
|
40
|
40
|
|
|
40
|
|
14128
|
use Net::Gnats::Command::QUIT; |
|
40
|
|
|
|
|
86
|
|
|
40
|
|
|
|
|
88242
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Net::Gnats::Command - Command factory and base class. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 VERSION |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
0.18 |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Encapsulates all Gnats Daemon commands and their command processing |
53
|
|
|
|
|
|
|
codes. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This module implements the factory pattern for retrieving specific |
56
|
|
|
|
|
|
|
commands. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
our @EXPORT_OK = |
61
|
|
|
|
|
|
|
qw(admv appn chdb chek dbdesc dbls delete_pr edit editaddr expr fdsc |
62
|
|
|
|
|
|
|
fieldflags ftyp ftypinfo fvld inputdefault list lkdb lock_pr qfmt |
63
|
|
|
|
|
|
|
quer quit repl rset subm undb unlk user vfld); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 new |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Instantiates a new L object. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
$c = Net::Gnats::Command->new; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This class is not instantiated directly; it is a superclass for all Gnats |
74
|
|
|
|
|
|
|
command objects. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
sub new { |
79
|
1
|
|
|
1
|
1
|
9
|
my ($class, %options) = @_; |
80
|
|
|
|
|
|
|
|
81
|
1
|
|
|
|
|
3
|
my $self = bless {}, $class; |
82
|
1
|
|
|
|
|
5
|
return $self; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 ACCESSORS |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 field |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Sets and retrieves a L to the command. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub field { |
94
|
16
|
|
|
16
|
1
|
27
|
my ( $self, $value ) = @_; |
95
|
16
|
100
|
|
|
|
78
|
return $self->{field} if not defined $value; |
96
|
4
|
100
|
|
|
|
15
|
return $self->{field} if not defined reftype($value); |
97
|
3
|
100
|
|
|
|
14
|
return $self->{field} if not reftype($value) eq 'HASH'; |
98
|
2
|
100
|
|
|
|
20
|
return $self->{field} if not $value->isa('Net::Gnats::FieldInstance'); |
99
|
|
|
|
|
|
|
|
100
|
1
|
|
|
|
|
3
|
$self->{field} = $value; |
101
|
1
|
|
|
|
|
3
|
return $self->{field}; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 field_change_reason |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Sets and retrieves a L for Change Reasons to the |
107
|
|
|
|
|
|
|
command. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
This may be removed in the future given a FieldInstance now manages its own |
110
|
|
|
|
|
|
|
Change Reason. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub field_change_reason { |
115
|
8
|
|
|
8
|
1
|
12
|
my ( $self, $value ) = @_; |
116
|
8
|
100
|
|
|
|
27
|
return $self->{field_change_reason} if not defined $value; |
117
|
4
|
100
|
|
|
|
16
|
return $self->{field_change_reason} if not defined reftype($value); |
118
|
3
|
100
|
|
|
|
13
|
return $self->{field_change_reason} if not reftype($value) eq 'HASH'; |
119
|
2
|
100
|
|
|
|
13
|
return $self->{field_change_reason} |
120
|
|
|
|
|
|
|
if not $value->isa('Net::Gnats::FieldInstance'); |
121
|
|
|
|
|
|
|
|
122
|
1
|
|
|
|
|
2
|
$self->{field_change_reason} = $value; |
123
|
1
|
|
|
|
|
4
|
return $self->{field_change_reason}; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head2 pr |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
For commands that must send a serialized PR, or serialized field, after issuing a command. |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=cut |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
sub pr { |
133
|
11
|
|
|
11
|
1
|
19
|
my ( $self, $value ) = @_; |
134
|
11
|
100
|
|
|
|
48
|
return $self->{pr} if not defined $value; |
135
|
4
|
100
|
|
|
|
14
|
return $self->{pr} if not defined reftype($value); |
136
|
3
|
100
|
|
|
|
15
|
return $self->{pr} if not reftype($value) eq 'HASH'; |
137
|
2
|
100
|
|
|
|
14
|
return $self->{pr} if not $value->isa('Net::Gnats::PR'); |
138
|
|
|
|
|
|
|
|
139
|
1
|
|
|
|
|
2
|
$self->{pr} = $value; |
140
|
1
|
|
|
|
|
4
|
return $self->{pr}; |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head2 error_codes |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Retrieves the valid error codes for the command. Not used yet. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
my $codes = $c->error_codes; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=cut |
150
|
|
|
|
|
|
|
|
151
|
1
|
|
|
1
|
1
|
4
|
sub error_codes { shift->{error_codes} } |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head2 success_codes |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Retrieves the valid success codes for the command. Not used yet. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
my $codes = $c->success_codes; |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=cut |
161
|
|
|
|
|
|
|
|
162
|
1
|
|
|
1
|
1
|
3
|
sub success_codes { shift->{success_codes} } |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head2 response |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
Manages the response outcome from the server encapsulated in a |
167
|
|
|
|
|
|
|
L object. |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
When the command has not been issued yet, the value will be undef. |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
$response = $c->response; |
172
|
|
|
|
|
|
|
$code = $c->response->code; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=cut |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
sub response { |
177
|
6644
|
|
|
6644
|
1
|
6209
|
my ($self, $value) = @_; |
178
|
6644
|
100
|
|
|
|
10369
|
$self->{response} = $value if defined $value; |
179
|
6644
|
|
|
|
|
14982
|
return $self->{response}; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=head2 requests_multi |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
A flag for knowing if multiple responses are expected. Normally used and |
185
|
|
|
|
|
|
|
managed internally. May become a private method later. |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=cut |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
sub requests_multi { |
190
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
191
|
1
|
|
|
|
|
4
|
return $self->{requests_multi}; |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=head1 METHODS |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head2 as_string |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
Returns the currently configured command as a string. |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=cut |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
sub as_string { |
204
|
10
|
|
|
10
|
1
|
29
|
my ( $self ) = @_; |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=head2 from |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
This method is used for commands where 1..n fields can be defined for a given |
210
|
|
|
|
|
|
|
command, and the issuer needs to match up field names to values. |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
$c = Net::Gnats::Command->fdsc( [ 'FieldA', 'FieldB' ]; |
213
|
|
|
|
|
|
|
Net::Gnats->current_session->issue( $c ); |
214
|
|
|
|
|
|
|
$value = $c->from( 'FieldA' ) unless not $c->is_ok; |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=cut |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
sub from { |
219
|
3648
|
|
|
3648
|
1
|
3253
|
my ( $self, $value ) = @_; |
220
|
|
|
|
|
|
|
# identify idx of value |
221
|
3648
|
|
|
|
|
2953
|
my @fields = @{ $self->{fields} }; |
|
3648
|
|
|
|
|
11628
|
|
222
|
3648
|
|
|
|
|
6789
|
my ( $index )= grep { $fields[$_] =~ /$value/ } 0..$#fields; |
|
87552
|
|
|
|
|
120793
|
|
223
|
3648
|
|
|
|
|
4307
|
return @{ $self->response->as_list }[$index]; |
|
3648
|
|
|
|
|
5328
|
|
224
|
|
|
|
|
|
|
} |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=head1 EXPORTED METHODS |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
The following exported methods are helpers for executing all Gnats |
229
|
|
|
|
|
|
|
protocol commands. |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=head2 admv |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
my $c = Net::Gnats::Command->admv; |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=cut |
236
|
|
|
|
|
|
|
|
237
|
1
|
|
|
1
|
1
|
2
|
sub admv { shift; return Net::Gnats::Command::ADMV->new( @_ ); } |
|
1
|
|
|
|
|
4
|
|
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=head2 appn |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
Manages the command for appending field content to an existing PR field. The |
242
|
|
|
|
|
|
|
field key is a L object. |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
$c = Net::Gnats::Command->appn( pr_number => 5, field => $field ); |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
See L for details. |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=cut |
249
|
|
|
|
|
|
|
|
250
|
4
|
|
|
4
|
1
|
13
|
sub appn { shift; return Net::Gnats::Command::APPN->new( @_ ); } |
|
4
|
|
|
|
|
12
|
|
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
=head2 chdb |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
Manages the command for changing databases within the same |
255
|
|
|
|
|
|
|
L instance. |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
$c = Net::Gnats::Command->chdb( database => 'external' ); |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
See L for details. |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=cut |
262
|
|
|
|
|
|
|
|
263
|
2
|
|
|
2
|
1
|
4
|
sub chdb { shift; return Net::Gnats::Command::CHDB->new( @_ ); } |
|
2
|
|
|
|
|
10
|
|
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=head2 chek |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
Manages the command for checking the validity of a PR before sending. |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
# New problem reports: |
270
|
|
|
|
|
|
|
$c = Net::Gnats::Command->chek( type => 'initial', pr => $pr ); |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
# Existing problem reports: |
273
|
|
|
|
|
|
|
$c = Net::Gnats::Command->chek( pr => $pr ); |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
See L for details. |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
=cut |
278
|
|
|
|
|
|
|
|
279
|
1
|
|
|
1
|
1
|
3
|
sub chek { shift; return Net::Gnats::Command::CHEK->new( @_ ); } |
|
1
|
|
|
|
|
4
|
|
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=head2 dbls |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
Manages the command to list server databases. This command is the only command |
284
|
|
|
|
|
|
|
that typically does not require credentials. |
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
$c = Net::Gnats::Command->dbls; |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
See L for details. |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=cut |
291
|
|
|
|
|
|
|
|
292
|
7
|
|
|
7
|
1
|
24
|
sub dbls { shift; return Net::Gnats::Command::DBLS->new( @_ ); } |
|
7
|
|
|
|
|
36
|
|
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=head2 dbdesc |
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
Manages the command for returning the description of the databases existing on |
297
|
|
|
|
|
|
|
the server. |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
$c = Net::Gnats::Command->dbdesc; |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
See L for details. |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
=cut |
304
|
|
|
|
|
|
|
|
305
|
3
|
|
|
3
|
1
|
11
|
sub dbdesc { shift; return Net::Gnats::Command::DBDESC->new( @_ ); } |
|
3
|
|
|
|
|
13
|
|
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=head2 delete_pr |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
Manages the command for deleting a PR from the database. Only those with |
310
|
|
|
|
|
|
|
'admin' credentials can successfully issue this command. |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
$c = Net::Gnats::Command->delete_pr( pr => $pr ); |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
See L for details. |
315
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=cut |
317
|
|
|
|
|
|
|
|
318
|
1
|
|
|
1
|
1
|
2
|
sub delete_pr { shift; return Net::Gnats::Command::DELETE->new( @_ ); } |
|
1
|
|
|
|
|
8
|
|
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=head2 edit |
321
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
Manages the command for submitting an update to an existing PR to the database. |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
$c = Net::Gnats::Command->edit( pr => $pr ); |
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
See L for details. |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=cut |
329
|
|
|
|
|
|
|
|
330
|
5
|
|
|
5
|
1
|
20
|
sub edit { shift; return Net::Gnats::Command::EDIT->new( @_ ); } |
|
5
|
|
|
|
|
27
|
|
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=head2 editaddr |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
Manages the command for setting the active email address for the session. This |
335
|
|
|
|
|
|
|
is most relevant when submitting or editing PRs. |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
$address = 'joe@somewhere.com'; |
338
|
|
|
|
|
|
|
$c = Net::Gnats::Command->editaddr( address => $address ); |
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
See L for details. |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=cut |
343
|
|
|
|
|
|
|
|
344
|
4
|
|
|
4
|
1
|
13
|
sub editaddr { shift; return Net::Gnats::Command::EDITADDR->new( @_ ); } |
|
4
|
|
|
|
|
24
|
|
345
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
=head2 expr |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
Manages the command for setting the query expression for a PR. Query |
349
|
|
|
|
|
|
|
expressions AND together. |
350
|
|
|
|
|
|
|
|
351
|
|
|
|
|
|
|
This method may change in the future. |
352
|
|
|
|
|
|
|
|
353
|
|
|
|
|
|
|
$c = Net::Gnats::Command->expr( expressions => ['foo="bar"', 'bar="baz"'] ); |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
See L for details. |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
=cut |
358
|
|
|
|
|
|
|
|
359
|
7
|
|
|
7
|
1
|
14
|
sub expr { shift; return Net::Gnats::Command::EXPR->new( @_ ); } |
|
7
|
|
|
|
|
33
|
|
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
=head2 fdsc |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
Manages the command for retrieving the description for one or more fields. |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
$c = Net::Gnats::Command->fdsc( fields => 'MyField' ); |
366
|
|
|
|
|
|
|
$c = Net::Gnats::Command->fdsc( fields => [ 'Field1', 'Field2' ] ); |
367
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
See L for details. |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
=cut |
371
|
|
|
|
|
|
|
|
372
|
41
|
|
|
41
|
1
|
80
|
sub fdsc { shift; return Net::Gnats::Command::FDSC->new( @_ ); } |
|
41
|
|
|
|
|
326
|
|
373
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=head2 fieldflags |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
Manages the command for retrieving field flags for one or more fields. |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
$c = Net::Gnats::Command->fieldflags( fields => 'MyField' ); |
379
|
|
|
|
|
|
|
$c = Net::Gnats::Command->fieldflags( fields => [ 'Field1', 'Field2' ] ); |
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
See L for details. |
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=cut |
384
|
|
|
|
|
|
|
|
385
|
41
|
|
|
41
|
1
|
62
|
sub fieldflags { shift; return Net::Gnats::Command::FIELDFLAGS->new( @_ ); } |
|
41
|
|
|
|
|
292
|
|
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=head2 ftyp |
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
Manages the command for retrieving the data type for one or more fields. |
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
$c = Net::Gnats::Command->ftyp( fields => 'MyField' ); |
392
|
|
|
|
|
|
|
$c = Net::Gnats::Command->ftyp( fields => [ 'Field1', 'Field2' ] ); |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
See L for details. |
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
=cut |
397
|
|
|
|
|
|
|
|
398
|
46
|
|
|
46
|
1
|
88
|
sub ftyp { shift; return Net::Gnats::Command::FTYP->new( @_ ); } |
|
46
|
|
|
|
|
392
|
|
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
=head2 ftypinfo |
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
Manages the command for retrieving the type information for a field. Relevant |
403
|
|
|
|
|
|
|
to MultiEnum fields only. |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
$c = Net::Gnats::Command->ftypinfo( field => 'MyField' ); |
406
|
|
|
|
|
|
|
$c = Net::Gnats::Command->ftypinfo( field => 'MyField', |
407
|
|
|
|
|
|
|
property => 'separators ); |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
See L for details. |
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=cut |
412
|
|
|
|
|
|
|
|
413
|
3
|
|
|
3
|
1
|
9
|
sub ftypinfo { shift; return Net::Gnats::Command::FTYPINFO->new( @_ ); } |
|
3
|
|
|
|
|
12
|
|
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
=head2 fvld |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
Manages the command for retrieving the set field validators defined in the |
418
|
|
|
|
|
|
|
Gnats schema. |
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
$c = Net::Gnats::Command->fvld( field => 'MyField' ); |
421
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
See L for details. |
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
=cut |
425
|
|
|
|
|
|
|
|
426
|
3
|
|
|
3
|
1
|
7
|
sub fvld { shift; return Net::Gnats::Command::FVLD->new( @_ ); } |
|
3
|
|
|
|
|
11
|
|
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
=head2 inputdefault |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
Manages the command for retrieving field default values. |
431
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
$c = Net::Gnats::Command->inputdefault( fields => 'MyField' ); |
433
|
|
|
|
|
|
|
$c = Net::Gnats::Command->inputdefault( fields => [ 'Field1', 'Field2' ] ); |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
See L for details. |
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
=cut |
438
|
|
|
|
|
|
|
|
439
|
41
|
|
|
41
|
1
|
76
|
sub inputdefault { shift; return Net::Gnats::Command::INPUTDEFAULT->new( @_ ); } |
|
41
|
|
|
|
|
323
|
|
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
=head2 list |
442
|
|
|
|
|
|
|
|
443
|
|
|
|
|
|
|
Manages the command for different lists that can be retrieved from Gnats. |
444
|
|
|
|
|
|
|
|
445
|
|
|
|
|
|
|
$c = Net::Gnats::Command->list( subcommand => 'Categories' ); |
446
|
|
|
|
|
|
|
$c = Net::Gnats::Command->list( subcommand => 'Submitters' ); |
447
|
|
|
|
|
|
|
$c = Net::Gnats::Command->list( subcommand => 'Responsible' ); |
448
|
|
|
|
|
|
|
$c = Net::Gnats::Command->list( subcommand => 'States' ); |
449
|
|
|
|
|
|
|
$c = Net::Gnats::Command->list( subcommand => 'FieldNames' ); |
450
|
|
|
|
|
|
|
$c = Net::Gnats::Command->list( subcommand => 'InitialInputFields' ); |
451
|
|
|
|
|
|
|
$c = Net::Gnats::Command->list( subcommand => 'InitialRequiredFields' ); |
452
|
|
|
|
|
|
|
$c = Net::Gnats::Command->list( subcommand => 'Databases' ); |
453
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
See L for details. |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
=cut |
457
|
|
|
|
|
|
|
|
458
|
133
|
|
|
133
|
1
|
169
|
sub list { shift; return Net::Gnats::Command::LIST->new( @_ ); } |
|
133
|
|
|
|
|
556
|
|
459
|
|
|
|
|
|
|
|
460
|
|
|
|
|
|
|
=head2 lkdb |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
Manages the command for locking the gnats main database. |
463
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
$c = Net::Gnats::Command->lkdb; |
465
|
|
|
|
|
|
|
|
466
|
|
|
|
|
|
|
See L for details. |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
=cut |
469
|
|
|
|
|
|
|
|
470
|
4
|
|
|
4
|
1
|
11
|
sub lkdb { shift; return Net::Gnats::Command::LKDB->new( @_ ); } |
|
4
|
|
|
|
|
15
|
|
471
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
=head2 lock_pr |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
Manages the command for locking a specific PR. Usually this occurs prior to |
475
|
|
|
|
|
|
|
updating a PR through the edit command. |
476
|
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
$c = Net::Gnats::Command->lock_pr( pr => $pr, user => $user ); |
478
|
|
|
|
|
|
|
$c = Net::Gnats::Command->lock_pr( pr => $pr, user => $user, pid => $pid ); |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
See L for details. |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
=cut |
483
|
|
|
|
|
|
|
|
484
|
9
|
|
|
9
|
1
|
28
|
sub lock_pr { shift; return Net::Gnats::Command::LOCK->new( @_ ); } |
|
9
|
|
|
|
|
36
|
|
485
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
=head2 qfmt |
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
Manages the command for setting the PR output format. Net::Gnats parses 'full' |
489
|
|
|
|
|
|
|
format only. If you choose another format, you can retrieve the response via |
490
|
|
|
|
|
|
|
$c->response->as_string. |
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
$c = Net::Gnats::Command->qfmt( format => 'full' ); |
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
See L for details. |
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
=cut |
497
|
|
|
|
|
|
|
|
498
|
14
|
|
|
14
|
1
|
25
|
sub qfmt { shift; return Net::Gnats::Command::QFMT->new( @_ ); } |
|
14
|
|
|
|
|
72
|
|
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
=head2 quer |
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
Manages the command for querying Gnats. It assumes the expressions have |
503
|
|
|
|
|
|
|
already been set. If specific numbers are set, the command will query only |
504
|
|
|
|
|
|
|
those PR numbers. |
505
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
$c = Net::Gnats::Command->quer; |
507
|
|
|
|
|
|
|
$c = Net::Gnats::Command->quer( pr_numbers => ['10'] ); |
508
|
|
|
|
|
|
|
$c = Net::Gnats::Command->quer( pr_numbers => ['10', '12'] ); |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
See L for details. |
511
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
=cut |
513
|
|
|
|
|
|
|
|
514
|
14
|
|
|
14
|
1
|
33
|
sub quer { shift; return Net::Gnats::Command::QUER->new( @_ ); } |
|
14
|
|
|
|
|
94
|
|
515
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
=head2 quit |
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
Manages the command for disconnecting the current Gnats session. |
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
$c = Net::Gnats::Command->quit; |
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
See L for details. |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
=cut |
525
|
|
|
|
|
|
|
|
526
|
5
|
|
|
5
|
1
|
6
|
sub quit { shift; return Net::Gnats::Command::QUIT->new( @_ ); } |
|
5
|
|
|
|
|
32
|
|
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
=head2 repl |
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
Manages the command for replacing field contents. |
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
$c = Net::Gnats::Command->appn( pr_number => 5, field => $field ); |
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
See L for details. |
535
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
=cut |
537
|
|
|
|
|
|
|
|
538
|
8
|
|
|
8
|
1
|
18
|
sub repl { shift; return Net::Gnats::Command::REPL->new( @_ ); } |
|
8
|
|
|
|
|
40
|
|
539
|
|
|
|
|
|
|
|
540
|
|
|
|
|
|
|
=head2 rset |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
Manages the command for resetting the index and any query expressions on the |
543
|
|
|
|
|
|
|
server. |
544
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
$c = Net::Gnats::Command->rset; |
546
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
See L for details. |
548
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
=cut |
550
|
|
|
|
|
|
|
|
551
|
12
|
|
|
12
|
1
|
23
|
sub rset { shift; return Net::Gnats::Command::RSET->new( @_ ); } |
|
12
|
|
|
|
|
79
|
|
552
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
=head2 subm |
554
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
Manages the command for submitting a new PR to Gnats. If the named PR already |
556
|
|
|
|
|
|
|
has a 'Number', a new PR with the same field contents will be created. |
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
$c = Net::Gnats::Command->subm( pr => $pr ); |
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
See L for details. |
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
=cut |
563
|
|
|
|
|
|
|
|
564
|
7
|
|
|
7
|
1
|
18
|
sub subm { shift; return Net::Gnats::Command::SUBM->new( @_ ); } |
|
7
|
|
|
|
|
30
|
|
565
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
=head2 undb |
567
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
Manages the command for unlocking the Gnats main database. |
569
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
$c = Net::Gnats::Command->undb; |
571
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
See L for details. |
573
|
|
|
|
|
|
|
|
574
|
|
|
|
|
|
|
=cut |
575
|
|
|
|
|
|
|
|
576
|
1
|
|
|
1
|
1
|
6
|
sub undb { shift; return Net::Gnats::Command::UNDB->new( @_ ); } |
|
1
|
|
|
|
|
10
|
|
577
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
=head2 unlk |
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
Manages the command for unlocking a specific PR. |
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
$c = Net::Gnats::Command->unlk( pr_number => $pr->get_field('Number')->value ); |
583
|
|
|
|
|
|
|
|
584
|
|
|
|
|
|
|
See L for details. |
585
|
|
|
|
|
|
|
|
586
|
|
|
|
|
|
|
=cut |
587
|
|
|
|
|
|
|
|
588
|
4
|
|
|
4
|
1
|
13
|
sub unlk { shift; return Net::Gnats::Command::UNLK->new( @_ ); } |
|
4
|
|
|
|
|
25
|
|
589
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
=head2 user |
591
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
Manages the command for setting the security context for the session. |
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
$c = Net::Gnats::Command->user( username => $username, password => $password ); |
595
|
|
|
|
|
|
|
|
596
|
|
|
|
|
|
|
See L for details. |
597
|
|
|
|
|
|
|
|
598
|
|
|
|
|
|
|
=cut |
599
|
|
|
|
|
|
|
|
600
|
85
|
|
|
85
|
1
|
132
|
sub user { shift; return Net::Gnats::Command::USER->new( @_ ); } |
|
85
|
|
|
|
|
436
|
|
601
|
|
|
|
|
|
|
|
602
|
|
|
|
|
|
|
=head2 vfld |
603
|
|
|
|
|
|
|
|
604
|
|
|
|
|
|
|
Manages the command for validating a specific field. The field is a |
605
|
|
|
|
|
|
|
L object. |
606
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
$c = Net::Gnats::Command->vfld( field => $field ); |
608
|
|
|
|
|
|
|
$c = Net::Gnats::Command->vfld( field => $pr->get_field('Synopsis'); |
609
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
See L for details. |
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
=cut |
613
|
|
|
|
|
|
|
|
614
|
2
|
|
|
2
|
1
|
9
|
sub vfld { shift; return Net::Gnats::Command::VFLD->new( @_ ); } |
|
2
|
|
|
|
|
39
|
|
615
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
1; |