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
use clap::Subcommand;
#[derive(Subcommand)]
pub enum AttachmentAction {
/// List attachments on a bug
List {
/// Bug ID
bug_id: u64,
},
/// Download an attachment
Download {
/// Attachment ID
id: u64,
/// Output file path (defaults to original filename)
#[arg(short = 'o', long = "out", id = "out_file")]
out: Option<String>,
},
/// Upload an attachment to a bug
Upload {
/// Bug ID
bug_id: u64,
/// File to upload
file: String,
/// Attachment summary/description
#[arg(long)]
summary: Option<String>,
/// MIME type (auto-detected if not provided)
#[arg(long)]
content_type: Option<String>,
/// Set flags (e.g. "review?(user@example.com)")
#[arg(long)]
flag: Vec<String>,
},
/// Update an attachment
Update {
/// Attachment ID
id: u64,
/// New summary
#[arg(long)]
summary: Option<String>,
/// New file name
#[arg(long)]
file_name: Option<String>,
/// New content type
#[arg(long)]
content_type: Option<String>,
/// Mark as obsolete
#[arg(long)]
obsolete: Option<bool>,
/// Mark as patch
#[arg(long)]
is_patch: Option<bool>,
/// Mark as private
#[arg(long)]
is_private: Option<bool>,
/// Set flags (e.g. "review?(user@example.com)")
#[arg(long)]
flag: Vec<String>,
},
}