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
use clap::Subcommand;
use crate::types::AuthMethod;
#[derive(Subcommand)]
pub enum ConfigAction {
/// Set up a server
SetServer {
/// Server alias name
name: String,
/// Server URL
#[arg(long)]
url: String,
/// API key (less secure: may leak via shell history or process args)
#[arg(
long,
conflicts_with = "api_key_env",
required_unless_present = "api_key_env"
)]
api_key: Option<String>,
/// Name of an environment variable that contains the API key
#[arg(long, conflicts_with = "api_key", required_unless_present = "api_key")]
api_key_env: Option<String>,
/// Login email (required for older Bugzilla servers)
#[arg(long)]
email: Option<String>,
/// Override auto-detected auth method (`header` or `query_param`)
#[arg(long)]
auth_method: Option<AuthMethod>,
/// Accept invalid TLS certificates (self-signed, expired, wrong host)
#[arg(long)]
tls_insecure: bool,
},
/// Set the default server
SetDefault {
/// Server alias name
name: String,
},
/// Show current configuration
Show,
/// Store an API key for a server in the OS keychain (prompts stdin)
SetKeyring {
/// Server alias name (must already exist)
name: String,
/// Override keyring service name (defaults to "bzr")
#[arg(long)]
service: Option<String>,
/// Override keyring account name (defaults to the server name)
#[arg(long)]
account: Option<String>,
},
/// Remove a server's API key from the OS keychain
UnsetKeyring {
/// Server alias name
name: String,
},
/// Migrate a server's existing inline/env API key into the OS keychain
MigrateToKeyring {
/// Server alias name
name: String,
/// Override keyring service name (defaults to "bzr")
#[arg(long)]
service: Option<String>,
/// Override keyring account name (defaults to the server name)
#[arg(long)]
account: Option<String>,
/// Skip confirmation prompt
#[arg(long)]
yes: bool,
},
}