From da57d1187ae3f7853fab4b83760b26c08f517e00 Mon Sep 17 00:00:00 2001
From: Yaroslav Dynnikov <yaroslav.dynnikov@gmail.com>
Date: Wed, 21 Aug 2024 20:41:16 +0300
Subject: [PATCH] docs: revise picodata run help

---
 src/cli/args.rs | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/cli/args.rs b/src/cli/args.rs
index 93092a8050..efa2ee0dd1 100644
--- a/src/cli/args.rs
+++ b/src/cli/args.rs
@@ -49,7 +49,7 @@ pub struct Run {
     #[clap(long, value_name = "PATH", env = "PICODATA_CONFIG_FILE")]
     /// Path to configuration file in yaml format.
     ///
-    /// `./config.yaml` is used by default, if it exists.
+    /// By default "./config.yaml" is used if it exists.
     pub config: Option<PathBuf>,
 
     #[clap(
@@ -81,8 +81,15 @@ pub struct Run {
         value_name = "[HOST][:PORT]",
         env = "PICODATA_ADVERTISE"
     )]
-    /// Address the other instances should use to connect to this instance.
-    /// Defaults to `--listen` value.
+    /// Public network address of the instance. It is announced to the
+    /// cluster during the instance start. Later it's used by other
+    /// instances for connecting to this one.
+    ///
+    /// Defaults to `--listen` value which is enough in most cases. But,
+    /// for example, in case of `--listen 0.0.0.0` it should be
+    /// specified explicitly:
+    ///
+    /// picodata run --listen 0.0.0.0:3301 --advertise 192.168.0.1:3301
     pub advertise_address: Option<IprotoAddress>,
 
     #[clap(
@@ -111,7 +118,8 @@ pub struct Run {
     /// Used during cluster initialization
     /// and joining an instance to an existing cluster.
     ///
-    /// By default "localhost:3301" is used.
+    /// Defaults to `--advertise` value which results in creating a new
+    /// cluster
     pub peers: Vec<IprotoAddress>,
 
     #[clap(
-- 
GitLab