summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-04-03 18:26:38 +0200
committertroido <troido@protonmail.com>2020-04-03 18:26:38 +0200
commitfd0bd24fa4e98b3bcd95a14ff844411727fb4433 (patch)
tree06e924a0f1ba31abb2e3d1cfb40d9b1f9354e01f /src/config.rs
parent94ec558680b70ed747519d5fd787d94b74ae470d (diff)
added command line options
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
new file mode 100644
index 0000000..9d2c480
--- /dev/null
+++ b/src/config.rs
@@ -0,0 +1,19 @@
+
+use structopt::StructOpt;
+use std::path::PathBuf;
+use crate::Address;
+
+#[derive(Debug, StructOpt)]
+#[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\"")]
+ 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)")]
+ pub content_dir: Option<PathBuf>,
+
+ #[structopt(short, long, env="ASCIIFARM_SAVE_DIR", help="The directory in which the savegames are")]
+ pub save_dir: Option<PathBuf>,
+
+}