From b5213f39086a45dfa62d04cfb33d7d530fd440c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogdan-=C8=98tefan=20Neac=C5=9Fu?= Date: Wed, 8 Feb 2023 13:00:58 +0200 Subject: [PATCH] Hide coconut runtime flags (#2990) --- clients/native/src/commands/init.rs | 4 ++-- clients/native/src/commands/run.rs | 4 ++-- clients/socks5/src/commands/init.rs | 4 ++-- clients/socks5/src/commands/run.rs | 4 ++-- gateway/src/commands/init.rs | 5 +++-- gateway/src/commands/run.rs | 5 +++-- nym-api/src/support/cli/mod.rs | 9 +++++++-- 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/clients/native/src/commands/init.rs b/clients/native/src/commands/init.rs index a49cb6101c..9fdab2fd5f 100644 --- a/clients/native/src/commands/init.rs +++ b/clients/native/src/commands/init.rs @@ -31,7 +31,7 @@ pub(crate) struct Init { force_register_gateway: bool, /// Comma separated list of rest endpoints of the nyxd validators - #[clap(long, alias = "nymd_validators", value_delimiter = ',')] + #[clap(long, alias = "nymd_validators", value_delimiter = ',', hide = true)] nyxd_urls: Option>, /// Comma separated list of rest endpoints of the API validators @@ -62,7 +62,7 @@ pub(crate) struct Init { /// Set this client to work in a enabled credentials mode that would attempt to use gateway /// with bandwidth credential requirement. - #[clap(long)] + #[clap(long, hide = true)] enabled_credentials_mode: Option, /// Save a summary of the initialization to a json file diff --git a/clients/native/src/commands/run.rs b/clients/native/src/commands/run.rs index ab9a04427e..e2e90082b3 100644 --- a/clients/native/src/commands/run.rs +++ b/clients/native/src/commands/run.rs @@ -23,7 +23,7 @@ pub(crate) struct Run { id: String, /// Comma separated list of rest endpoints of the nyxd validators - #[clap(long, alias = "nymd_validators", value_delimiter = ',')] + #[clap(long, alias = "nymd_validators", value_delimiter = ',', hide = true)] nyxd_urls: Option>, /// Comma separated list of rest endpoints of the API validators @@ -59,7 +59,7 @@ pub(crate) struct Run { /// Set this client to work in a enabled credentials mode that would attempt to use gateway /// with bandwidth credential requirement. - #[clap(long)] + #[clap(long, hide = true)] enabled_credentials_mode: Option, } diff --git a/clients/socks5/src/commands/init.rs b/clients/socks5/src/commands/init.rs index 94ea24db77..f459fc7e77 100644 --- a/clients/socks5/src/commands/init.rs +++ b/clients/socks5/src/commands/init.rs @@ -43,7 +43,7 @@ pub(crate) struct Init { force_register_gateway: bool, /// Comma separated list of rest endpoints of the nyxd validators - #[clap(long, alias = "nymd_validators", value_delimiter = ',')] + #[clap(long, alias = "nymd_validators", value_delimiter = ',', hide = true)] nyxd_urls: Option>, /// Comma separated list of rest endpoints of the API validators @@ -66,7 +66,7 @@ pub(crate) struct Init { /// Set this client to work in a enabled credentials mode that would attempt to use gateway /// with bandwidth credential requirement. - #[clap(long)] + #[clap(long, hide = true)] enabled_credentials_mode: Option, /// Save a summary of the initialization to a json file diff --git a/clients/socks5/src/commands/run.rs b/clients/socks5/src/commands/run.rs index cfb71032ba..80bbd02c47 100644 --- a/clients/socks5/src/commands/run.rs +++ b/clients/socks5/src/commands/run.rs @@ -43,7 +43,7 @@ pub(crate) struct Run { gateway: Option, /// Comma separated list of rest endpoints of the nyxd validators - #[clap(long, alias = "nymd_validators", value_delimiter = ',')] + #[clap(long, alias = "nymd_validators", value_delimiter = ',', hide = true)] nyxd_urls: Option>, /// Comma separated list of rest endpoints of the Nym APIs @@ -65,7 +65,7 @@ pub(crate) struct Run { /// Set this client to work in a enabled credentials mode that would attempt to use gateway /// with bandwidth credential requirement. - #[clap(long)] + #[clap(long, hide = true)] enabled_credentials_mode: Option, } diff --git a/gateway/src/commands/init.rs b/gateway/src/commands/init.rs index 45548d7cd8..046269dfe5 100644 --- a/gateway/src/commands/init.rs +++ b/gateway/src/commands/init.rs @@ -55,7 +55,8 @@ pub struct Init { long, alias = "validators", alias = "nymd_validators", - value_delimiter = ',' + value_delimiter = ',', + hide = true )] // the alias here is included for backwards compatibility (1.1.4 and before) nyxd_urls: Option>, @@ -66,7 +67,7 @@ pub struct Init { /// Set this gateway to work only with coconut credentials; that would disallow clients to /// bypass bandwidth credential requirement - #[clap(long)] + #[clap(long, hide = true)] only_coconut_credentials: Option, /// Enable/disable gateway anonymized statistics that get sent to a statistics aggregator server diff --git a/gateway/src/commands/run.rs b/gateway/src/commands/run.rs index d7d864193c..3f149b42fe 100644 --- a/gateway/src/commands/run.rs +++ b/gateway/src/commands/run.rs @@ -53,7 +53,8 @@ pub struct Run { long, alias = "validators", alias = "nymd_validators", - value_delimiter = ',' + value_delimiter = ',', + hide = true )] // the alias here is included for backwards compatibility (1.1.4 and before) nyxd_urls: Option>, @@ -64,7 +65,7 @@ pub struct Run { /// Set this gateway to work only with coconut credentials; that would disallow clients to /// bypass bandwidth credential requirement - #[clap(long)] + #[clap(long, hide = true)] only_coconut_credentials: Option, /// Enable/disable gateway anonymized statistics that get sent to a statistics aggregator server diff --git a/nym-api/src/support/cli/mod.rs b/nym-api/src/support/cli/mod.rs index 7e74b58e3c..292c7e9047 100644 --- a/nym-api/src/support/cli/mod.rs +++ b/nym-api/src/support/cli/mod.rs @@ -93,11 +93,16 @@ pub(crate) struct CliArgs { pub(crate) enabled_credentials_mode: Option, /// Announced address where coconut clients will connect. - #[clap(long)] + #[clap(long, hide = true)] pub(crate) announce_address: Option, /// Flag to indicate whether coconut signer authority is enabled on this API - #[clap(long, requires = "mnemonic", requires = "announce_address")] + #[clap( + long, + requires = "mnemonic", + requires = "announce_address", + hide = true + )] pub(crate) enable_coconut: Option, }