1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
use clap::Subcommand;
#[derive(Subcommand)]
pub enum BugAction {
/// List bugs with filters
List {
/// Filter by product (repeatable for OR; prefix with ! to exclude)
#[arg(long)]
product: Vec<String>,
/// Filter by component (repeatable for OR; prefix with ! to exclude)
#[arg(long)]
component: Vec<String>,
/// Filter by status (repeatable for OR; prefix with ! to exclude)
#[arg(long)]
status: Vec<String>,
/// Filter by assignee (repeatable for OR; prefix with ! to exclude)
#[arg(long)]
assignee: Vec<String>,
/// Filter by creator (repeatable for OR; prefix with ! to exclude)
#[arg(long)]
creator: Vec<String>,
/// Filter by priority (repeatable for OR; prefix with ! to exclude)
#[arg(long)]
priority: Vec<String>,
/// Filter by severity (repeatable for OR; prefix with ! to exclude)
#[arg(long)]
severity: Vec<String>,
/// Filter by bug IDs
#[arg(long)]
id: Vec<u64>,
/// Filter by alias
#[arg(long)]
alias: Option<String>,
/// Max number of results
#[arg(long, default_value = "50")]
limit: u32,
/// Only return these fields (comma-separated)
#[arg(long)]
fields: Option<String>,
/// Exclude these fields (comma-separated)
#[arg(long)]
exclude_fields: Option<String>,
},
/// View a bug by ID
View {
/// Bug ID or alias
id: String,
/// Only return these fields (comma-separated)
#[arg(long)]
fields: Option<String>,
/// Exclude these fields (comma-separated)
#[arg(long)]
exclude_fields: Option<String>,
},
/// Search bugs by text query
Search {
/// Search query
query: String,
/// Max number of results
#[arg(long, default_value = "50")]
limit: u32,
/// Only return these fields (comma-separated)
#[arg(long)]
fields: Option<String>,
/// Exclude these fields (comma-separated)
#[arg(long)]
exclude_fields: Option<String>,
},
/// Show change history of a bug
History {
/// Bug ID
id: u64,
/// Only show changes after this date (ISO 8601)
#[arg(long)]
since: Option<String>,
},
/// Create a new bug
Create {
/// Use a saved template for default field values
#[arg(long)]
template: Option<String>,
/// Product name (required unless provided by template)
#[arg(long)]
product: Option<String>,
/// Component name (required unless provided by template)
#[arg(long)]
component: Option<String>,
/// Bug summary
#[arg(long)]
summary: String,
/// Version
#[arg(long)]
version: Option<String>,
/// Bug description
#[arg(long)]
description: Option<String>,
/// Priority
#[arg(long)]
priority: Option<String>,
/// Severity
#[arg(long)]
severity: Option<String>,
/// Assignee
#[arg(long)]
assignee: Option<String>,
/// Operating system (required by some Bugzilla installations)
#[arg(long)]
op_sys: Option<String>,
/// Hardware platform (required by some Bugzilla installations)
#[arg(long)]
rep_platform: Option<String>,
/// Bug IDs that this bug blocks (comma-separated)
#[arg(long, value_delimiter = ',')]
blocks: Vec<u64>,
/// Bug IDs that this bug depends on (comma-separated)
#[arg(long, value_delimiter = ',')]
depends_on: Vec<u64>,
},
/// Show bugs related to the authenticated user
My {
/// Show bugs I created (instead of assigned to me)
#[arg(long)]
created: bool,
/// Show bugs I'm CC'd on (instead of assigned to me)
#[arg(long)]
cc: bool,
/// Show all bugs related to me (assigned + created + CC'd)
#[arg(long, conflicts_with_all = ["created", "cc"])]
all: bool,
/// Filter by status (repeatable for OR; prefix with ! to exclude)
#[arg(long)]
status: Vec<String>,
/// Max results per category (assigned/created/cc)
#[arg(long, default_value = "50")]
limit: u32,
/// Only return these fields (comma-separated)
#[arg(long)]
fields: Option<String>,
/// Exclude these fields (comma-separated)
#[arg(long)]
exclude_fields: Option<String>,
},
/// Clone an existing bug, optionally overriding fields
Clone {
/// Source bug ID or alias
id: String,
/// Override summary
#[arg(long)]
summary: Option<String>,
/// Override product
#[arg(long)]
product: Option<String>,
/// Override component
#[arg(long)]
component: Option<String>,
/// Override version
#[arg(long)]
version: Option<String>,
/// Override description
#[arg(long)]
description: Option<String>,
/// Override priority
#[arg(long)]
priority: Option<String>,
/// Override severity
#[arg(long)]
severity: Option<String>,
/// Override assignee
#[arg(long)]
assignee: Option<String>,
/// Override operating system
#[arg(long)]
op_sys: Option<String>,
/// Override hardware platform
#[arg(long)]
rep_platform: Option<String>,
/// Skip adding "Cloned from bug #N" comment
#[arg(long)]
no_comment: bool,
/// Make the new bug depend on the source bug
#[arg(long)]
add_depends_on: bool,
/// Make the new bug block the source bug
#[arg(long)]
add_blocks: bool,
/// Don't copy the CC list from the source bug
#[arg(long)]
no_cc: bool,
/// Don't copy keywords from the source bug
#[arg(long)]
no_keywords: bool,
},
/// Update an existing bug (supports multiple IDs for batch updates)
Update {
/// Bug ID(s)
#[arg(required = true, num_args = 1..)]
ids: Vec<u64>,
/// New status
#[arg(long)]
status: Option<String>,
/// Resolution (when closing)
#[arg(long)]
resolution: Option<String>,
/// Reassign
#[arg(long)]
assignee: Option<String>,
/// Priority
#[arg(long)]
priority: Option<String>,
/// Severity
#[arg(long)]
severity: Option<String>,
/// Summary
#[arg(long)]
summary: Option<String>,
/// Whiteboard
#[arg(long)]
whiteboard: Option<String>,
/// Set flags (e.g. "review?(user@example.com)")
#[arg(long)]
flag: Vec<String>,
/// Add bug IDs to blocks list (comma-separated)
#[arg(long, value_delimiter = ',')]
blocks_add: Vec<u64>,
/// Remove bug IDs from blocks list (comma-separated)
#[arg(long, value_delimiter = ',')]
blocks_remove: Vec<u64>,
/// Add bug IDs to depends-on list (comma-separated)
#[arg(long, value_delimiter = ',')]
depends_on_add: Vec<u64>,
/// Remove bug IDs from depends-on list (comma-separated)
#[arg(long, value_delimiter = ',')]
depends_on_remove: Vec<u64>,
},
}