From 6f6172e1f5eca85b418d541553c439ab80fac072 Mon Sep 17 00:00:00 2001 From: troido Date: Wed, 23 Sep 2020 14:30:55 +0200 Subject: give unix and ipv6 example in --address explanation --- src/config.rs | 2 +- src/server/address.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index ea1cab1..9e11d27 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,7 +7,7 @@ use crate::Address; #[structopt(name = "Rustifarm", about = "Asciifarm server in Rust")] pub struct Config { - #[structopt(short, long, help="A server type and address. Allowed server types: 'inet', 'unix', 'abstract'. Example: \"inet:127.0.0.1:1234\" or \"abstract:rustifarm\"")] + #[structopt(short, long, help="A server type and address. Allowed server types: 'inet', 'unix', 'abstract'. Example: \"inet:127.0.0.1:1234\" or \"abstract:rustifarm\" or \"unix:/tmp/rustifarm\" or \"inet:[::1]:1234\"")] pub address: Option>, #[structopt(short, long, env="ASCIIFARM_CONTENT_DIR", help="The directory in which the content specifying the world is (maps/encyclopaedia)")] diff --git a/src/server/address.rs b/src/server/address.rs index 64aea2d..0fe7c69 100644 --- a/src/server/address.rs +++ b/src/server/address.rs @@ -36,7 +36,7 @@ impl FromStr for Address { let typename = parts[0]; let text = parts[1]; match typename { - "inet" => Ok(Address::Inet(text.parse()?)), + "inet" => Ok(Address::Inet(text.parse().map_err(|e| aerr!("'{}' is not a valid inet address: {}", text, e))?)), "unix" => Ok(Address::Unix(PathBuf::new().join(text))), "abstract" => { if cfg!(target_os = "linux") { -- cgit