forked from mirrors/jj
cli: allow non-static version strings from custom binaries
We would like to use a non-static version string at Google. We have a workaround using Lazy, but it seems unfortunate to have to do that. Using dynamic strings requires Clap's `string` feature, which increases the binary size by 140 kiB (0.6%).
This commit is contained in:
parent
e354816236
commit
0046af8d4c
2 changed files with 8 additions and 3 deletions
|
@ -25,7 +25,12 @@ backoff = "0.4.0"
|
||||||
blake2 = "0.10.6"
|
blake2 = "0.10.6"
|
||||||
bytes = "1.5.0"
|
bytes = "1.5.0"
|
||||||
cargo_metadata = "0.17.0"
|
cargo_metadata = "0.17.0"
|
||||||
clap = { version = "4.4.13", features = ["derive", "deprecated", "wrap_help"] }
|
clap = { version = "4.4.13", features = [
|
||||||
|
"derive",
|
||||||
|
"deprecated",
|
||||||
|
"wrap_help",
|
||||||
|
"string",
|
||||||
|
] }
|
||||||
clap_complete = "4.4.6"
|
clap_complete = "4.4.6"
|
||||||
clap_mangen = "0.2.10"
|
clap_mangen = "0.2.10"
|
||||||
chrono = { version = "0.4.31", default-features = false, features = [
|
chrono = { version = "0.4.31", default-features = false, features = [
|
||||||
|
|
|
@ -2783,8 +2783,8 @@ impl CliRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the version to be displayed by `jj version`.
|
/// Set the version to be displayed by `jj version`.
|
||||||
pub fn version(mut self, version: &'static str) -> Self {
|
pub fn version(mut self, version: &str) -> Self {
|
||||||
self.app = self.app.version(version);
|
self.app = self.app.version(version.to_string());
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue