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
use clap::Subcommand;
#[derive(Subcommand)]
pub enum GroupAction {
/// Add a user to a group.
///
/// Requires Bugzilla admin permissions. The `--user` value can
/// be a login name, an email address, or a numeric user ID.
/// On Bugzilla 5.3+, this operation uses POST internally
/// (handled automatically by bzr).
///
/// Examples:
///
/// bzr group add-user --group editbugs --user alice@example.com
/// bzr group add-user --group admins --user bob
///
/// See bzr-group-remove-user(1) for the inverse and
/// bzr-group-list-users(1) to confirm membership.
#[command(verbatim_doc_comment)]
AddUser {
/// Group name
#[arg(long)]
group: String,
/// User email/login
#[arg(long)]
user: String,
},
/// Remove a user from a group.
///
/// Requires Bugzilla admin permissions. The `--user` value can
/// be a login name, an email address, or a numeric user ID.
/// Removing a user from a group does not delete or disable the
/// account -- only their group membership is revoked.
///
/// Examples:
///
/// bzr group remove-user --group editbugs --user alice@example.com
/// bzr group remove-user --group admins --user bob
///
/// See bzr-group-add-user(1) for the inverse and
/// bzr-user-update(1) to disable a user account entirely.
#[command(verbatim_doc_comment)]
RemoveUser {
/// Group name
#[arg(long)]
group: String,
/// User email/login
#[arg(long)]
user: String,
},
/// List the users in a group.
///
/// Prints the login name and real name of every member of the
/// group. `--details` adds login status (enabled, disabled,
/// last-login) and other group memberships. Visibility depends
/// on server configuration -- some installations require admin
/// privileges to enumerate group members.
///
/// Examples:
///
/// bzr group list-users --group editbugs
/// bzr group list-users --group editbugs --details --json
///
/// See bzr-group-view(1) for group metadata and
/// bzr-group-add-user(1) / bzr-group-remove-user(1) to modify
/// membership.
#[command(verbatim_doc_comment)]
ListUsers {
/// Group name
#[arg(long)]
group: String,
/// Show extended details (groups, login status)
#[arg(long)]
details: bool,
},
/// View group metadata (description, active flag, ID).
///
/// Prints the group's name, description, active status,
/// numeric ID, and any group-specific permissions. The
/// positional argument can be either the group name or its
/// numeric ID.
///
/// Examples:
///
/// bzr group view editbugs
/// bzr group view 42 --json
///
/// See bzr-group-list-users(1) to enumerate members.
#[command(verbatim_doc_comment)]
View {
/// Group name or ID
group: String,
},
/// Create a new Bugzilla group (admin only).
///
/// Requires Bugzilla admin permissions. Both `--name` and
/// `--description` are required. New groups are active by
/// default; pass `--is-active false` to create a disabled
/// group.
///
/// Examples:
///
/// bzr group create --name release-eng --description "Release Engineering"
/// bzr group create --name temp --description "Temporary" \
/// --is-active false
///
/// See bzr-group-update(1) to modify a group and
/// bzr-group-add-user(1) to populate it.
#[command(verbatim_doc_comment)]
Create {
/// Group name
#[arg(long)]
name: String,
/// Group description
#[arg(long)]
description: String,
/// Whether the group is active
#[arg(long, default_value = "true")]
is_active: bool,
},
/// Update an existing group's description or active state.
///
/// Requires Bugzilla admin permissions. Pass `--description`
/// to change the description and/or `--is-active` to enable or
/// disable the group. Renaming a group is not supported by the
/// Bugzilla REST API.
///
/// Examples:
///
/// bzr group update editbugs --description "Bug-edit privileges"
/// bzr group update temp --is-active false
///
/// See bzr-group-create(1) for new groups and
/// bzr-group-view(1) to inspect current state.
#[command(verbatim_doc_comment)]
Update {
/// Group name or ID
group: String,
/// New description
#[arg(long)]
description: Option<String>,
/// Whether the group is active
#[arg(long)]
is_active: Option<bool>,
},
}