diff --git a/src/commands/server_commands.rs b/src/commands/server_commands.rs index 1d205e5..b3c0099 100644 --- a/src/commands/server_commands.rs +++ b/src/commands/server_commands.rs @@ -516,6 +516,38 @@ pub trait ServerCommands<'a> { prepare_command(self, cmd("CONFIG").arg("GET").arg(params)) } + /// The command returns a helpful text describing the different CONFIG subcommands. + /// + /// # Return + /// An array of strings. + /// + /// # Example + /// ``` + /// # use rustis::{ + /// # client::Client, + /// # commands::ServerCommands, + /// # Result, + /// # }; + /// # + /// # #[cfg_attr(feature = "tokio-runtime", tokio::main)] + /// # #[cfg_attr(feature = "async-std-runtime", async_std::main)] + /// # async fn main() -> Result<()> { + /// # let client = Client::connect("127.0.0.1:6379").await?; + /// let result: Vec = client.config_help().await?; + /// assert!(result.iter().any(|e| e == "HELP")); + /// # Ok(()) + /// # } + /// ``` + /// # See Also + /// [](https://redis.io/commands/config-help/) + #[must_use] + fn config_help(self) -> PreparedCommand<'a, Self, Vec> + where + Self: Sized, + { + prepare_command(self, cmd("CONFIG").arg("HELP")) + } + /// Resets the statistics reported by Redis using the [`info`](ServerCommands::info) command. /// /// # See Also diff --git a/src/tests/server_commands.rs b/src/tests/server_commands.rs index 87f06dc..09d8800 100644 --- a/src/tests/server_commands.rs +++ b/src/tests/server_commands.rs @@ -467,6 +467,17 @@ async fn config_get() -> Result<()> { Ok(()) } +#[cfg_attr(feature = "tokio-runtime", tokio::main)] +#[cfg_attr(feature = "async-std-runtime", async_std::main)] +#[serial] +async fn config_help() -> Result<()> { + let client = get_test_client().await?; + let result: Vec = client.config_help().await?; + assert!(result.iter().any(|e| e == "HELP")); + + Ok(()) +} + #[cfg_attr(feature = "tokio-runtime", tokio::test)] #[cfg_attr(feature = "async-std-runtime", async_std::test)] #[serial]