From d928e430738f8edfae84da9b60eb909e6b8d513e Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Sat, 24 Aug 2024 22:10:33 -0500 Subject: [PATCH] cli: add `name()` and `about()` methods to `CliRunner` Useful for third party tools to override, along with the version. Signed-off-by: Austin Seipp --- cli/src/cli_util.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index d46d22e5f..0bb8f4c97 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -2857,6 +2857,18 @@ impl CliRunner { } } + /// Set the name of the CLI application to be displayed in help messages. + pub fn name(mut self, name: &str) -> Self { + self.app = self.app.name(name.to_string()); + self + } + + /// Set the about message to be displayed in help messages. + pub fn about(mut self, about: &str) -> Self { + self.app = self.app.about(about.to_string()); + self + } + /// Set the version to be displayed by `jj version`. pub fn version(mut self, version: &str) -> Self { self.app = self.app.version(version.to_string());