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
use clap::Subcommand;
use crate::types::ProductListType;
#[derive(Subcommand)]
#[expect(
clippy::doc_markdown,
reason = "doc examples are literal shell commands; wrapping URLs in <> or identifiers in backticks would degrade copy-paste UX"
)]
pub enum ProductAction {
/// List products visible to the caller.
///
/// `--type` selects which slice of the product catalog to list:
/// `accessible` (default) -- products the caller can see;
/// `selectable` -- products the caller can file bugs against;
/// `enterable` -- a strict subset of `selectable` that excludes
/// products marked closed for new bugs. Most users want
/// `accessible`.
///
/// Examples:
///
/// bzr product list
/// bzr product list --type selectable
/// bzr product list --json | jq '.products[].name'
///
/// See bzr-product-view(1) for one product's full details.
#[command(verbatim_doc_comment)]
List {
/// Product type: accessible (default), selectable, or enterable
#[arg(long, default_value = "accessible")]
r#type: ProductListType,
},
/// View a product's full details: components, versions, milestones.
///
/// Prints the product's description, classification, default
/// milestone, the list of components (with default assignees
/// and CC lists), the list of versions, and the list of target
/// milestones. Useful for discovering valid `--component` and
/// `--version` values to pass to `bzr bug create`.
///
/// Examples:
///
/// bzr product view Firefox
/// bzr product view Firefox --json | jq '.components[].name'
///
/// See bzr-product-list(1) for the catalog and bzr-bug-create(1)
/// for filing a bug against a product.
#[command(verbatim_doc_comment)]
View {
/// Product name
name: String,
},
/// Create a new Bugzilla product (admin only).
///
/// Requires Bugzilla admin permissions. Both `--name` and
/// `--description` are required. `--version` defaults to
/// "unspecified" -- this becomes the product's initial version
/// entry, which can be extended later via the Bugzilla web UI.
/// Products are open for bugs by default; pass `--is-open false`
/// to create a closed product.
///
/// New products have no components -- add at least one with
/// `bzr component create` before bugs can be filed.
///
/// Examples:
///
/// bzr product create --name MyApp --description "My Application"
/// bzr product create --name Legacy --description "Archived" \
/// --is-open false
///
/// See bzr-product-update(1) to modify a product and
/// bzr-component-create(1) to add components.
#[command(verbatim_doc_comment)]
Create {
/// Product name
#[arg(long)]
name: String,
/// Product description
#[arg(long)]
description: String,
/// Initial version
#[arg(long, default_value = "unspecified")]
version: String,
/// Whether the product is open for bugs
#[arg(long, default_value = "true")]
is_open: bool,
},
/// Update an existing product (admin only).
///
/// Requires Bugzilla admin permissions. Pass any of the flags
/// to change that property: `--description`,
/// `--default-milestone`, `--is-open`. Only the supplied fields
/// are modified. Renaming a product is not supported by the
/// Bugzilla REST API.
///
/// `--default-milestone` must reference a milestone that
/// already exists on the product (visible via
/// `bzr product view`).
///
/// Examples:
///
/// bzr product update Firefox --description "Web browser"
/// bzr product update Legacy --is-open false
/// bzr product update MyApp --default-milestone v2.0
///
/// See bzr-product-view(1) to inspect current state.
#[command(verbatim_doc_comment)]
Update {
/// Product name
name: String,
/// New description
#[arg(long)]
description: Option<String>,
/// Default milestone
#[arg(long)]
default_milestone: Option<String>,
/// Whether the product is open for bugs
#[arg(long)]
is_open: Option<bool>,
},
}