aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--example_config.toml12
-rw-r--r--src/main.rs4
2 files changed, 16 insertions, 0 deletions
diff --git a/example_config.toml b/example_config.toml
new file mode 100644
index 0000000..cd66403
--- /dev/null
+++ b/example_config.toml
@@ -0,0 +1,12 @@
+
+bind_addr = "127.0.0.1:9292"
+upstream_addr = "127.0.0.1:9200"
+allow_all_indices = false
+
+# Index-level configuration
+[[index]]
+name = "test"
+
+# Configure additional indices by repeating the [[index]] block
+#[[index]]
+#name = "some-other-index"
diff --git a/src/main.rs b/src/main.rs
index 0f94a84..342836f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -75,6 +75,10 @@ fn load_config() -> ProxyConfig {
println!("{}", usage());
std::process::exit(0);
}
+ [_, "--example-config"] => {
+ println!("{}", include_str!("../example_config.toml"));
+ std::process::exit(0);
+ },
[_, "--config", p] => config_path = Some(p.to_string()),
[_, "--allow-all-indices"] => allow_all_indices = true,
_ => {