diff options
| author | troido <troido@protonmail.com> | 2020-09-23 14:30:55 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-09-23 14:30:55 +0200 |
| commit | 6f6172e1f5eca85b418d541553c439ab80fac072 (patch) | |
| tree | 8e76377550e068e80ed87ee6d3ceab2d9596f82c | |
| parent | 276e31ee6793aadf6cde3d021803b78410012ecb (diff) | |
give unix and ipv6 example in --address explanation
| -rw-r--r-- | src/config.rs | 2 | ||||
| -rw-r--r-- | 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<Vec<Address>>, #[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") { |
