From ad59968436a60e42447f83ed37ffb39515b049a9 Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Sun, 2 Feb 2020 08:35:57 +0100 Subject: [PATCH] [server] Parse hostnames --- coffer-server/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coffer-server/src/main.rs b/coffer-server/src/main.rs index 2da71fa..2aff25f 100644 --- a/coffer-server/src/main.rs +++ b/coffer-server/src/main.rs @@ -7,7 +7,6 @@ use std::path::PathBuf; use std::fs::File; use std::io::{Read}; use structopt::StructOpt; -use std::net::SocketAddr; use coffer_common::keyring::Keyring; use coffer_common::coffer::Coffer; @@ -31,8 +30,10 @@ struct Args { secrets: PathBuf, /// Address, the coffer server should bind to - #[structopt(short, long, parse(try_from_str), env = "COFFER_SERVER_ADDRESS", default_value = "127.0.0.1:9187")] - address: SocketAddr, + #[structopt(short, long, env = "COFFER_SERVER_ADDRESS", default_value = "127.0.0.1:9187")] + address: String, // unfortunately we have to take a opaque string here, + // since we can't parse a hostname otherwise. + // Parsers are not customizable yet in structopt } #[tokio::main]