diff options
author | Nora Widdecke <nora@sequoia-pgp.org> | 2022-11-18 14:16:54 +0100 |
---|---|---|
committer | Nora Widdecke <nora@sequoia-pgp.org> | 2022-11-21 10:17:33 +0100 |
commit | daa6cad49144d3ee7a474f3c6eb96f80b54367fc (patch) | |
tree | 5dc509b95dbdf234d30fce3f51388e5ba2511b45 /sq | |
parent | 263104bfb3eb175b0ad144bc6c8eab52c232da43 (diff) |
sq: Make default keyserver explicit.
- Closes #947
Diffstat (limited to 'sq')
-rw-r--r-- | sq/sq-usage.md | 2 | ||||
-rw-r--r-- | sq/src/commands/net.rs | 7 | ||||
-rw-r--r-- | sq/src/sq_cli/keyserver.rs | 3 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sq/sq-usage.md b/sq/sq-usage.md index 3e159975..3f07bcaa 100644 --- a/sq/sq-usage.md +++ b/sq/sq-usage.md @@ -1311,6 +1311,8 @@ OPTIONS: -s, --server <URI> Sets the keyserver to use + [default: hkps://keys.openpgp.org] + SUBCOMMANDS: get Retrieves a key diff --git a/sq/src/commands/net.rs b/sq/src/commands/net.rs index 46d23a24..67767621 100644 --- a/sq/src/commands/net.rs +++ b/sq/src/commands/net.rs @@ -35,11 +35,8 @@ use crate::sq_cli; pub fn dispatch_keyserver(config: Config, c: sq_cli::keyserver::Command) -> Result<()> { let network_policy = c.network_policy.into(); - let mut ks = if let Some(uri) = c.server { - KeyServer::new(network_policy, &uri) - } else { - KeyServer::keys_openpgp_org(network_policy) - }.context("Malformed keyserver URI")?; + let mut ks = KeyServer::new(network_policy, &c.server) + .context("Malformed keyserver URI")?; let rt = tokio::runtime::Builder::new_current_thread() .enable_io() diff --git a/sq/src/sq_cli/keyserver.rs b/sq/src/sq_cli/keyserver.rs index d4647ba2..d0169cf2 100644 --- a/sq/src/sq_cli/keyserver.rs +++ b/sq/src/sq_cli/keyserver.rs @@ -22,10 +22,11 @@ pub struct Command { #[clap( short, long, + default_value = "hkps://keys.openpgp.org", value_name = "URI", help = "Sets the keyserver to use", )] - pub server: Option<String>, + pub server: String, #[clap(subcommand)] pub subcommand: Subcommands, } |