Skip to content

Commit

Permalink
cli: add name() and about() methods to CliRunner
Browse files Browse the repository at this point in the history
Useful for third party tools to override, along with the version.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
  • Loading branch information
thoughtpolice committed Aug 25, 2024
1 parent 6b65f8a commit d928e43
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit d928e43

Please sign in to comment.