mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-19 06:04:26 +00:00
cli: move $JJ_VERSION
out of CLI library
It should be up to the binary to decide which version it is. One should be able to build the library without specifying a version.
This commit is contained in:
parent
6cb64bd255
commit
39e83b9f4a
@ -2294,6 +2294,12 @@ impl CliRunner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set the version to be displayed by `jj version`.
|
||||||
|
pub fn version(mut self, version: &'static str) -> Self {
|
||||||
|
self.app = self.app.version(version);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Replaces `StoreFactories` to be used.
|
/// Replaces `StoreFactories` to be used.
|
||||||
pub fn set_store_factories(mut self, store_factories: StoreFactories) -> Self {
|
pub fn set_store_factories(mut self, store_factories: StoreFactories) -> Self {
|
||||||
self.store_factories = Some(store_factories);
|
self.store_factories = Some(store_factories);
|
||||||
|
@ -3473,8 +3473,7 @@ fn cmd_sparse(ui: &mut Ui, command: &CommandHelper, args: &SparseArgs) -> Result
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_app() -> Command {
|
pub fn default_app() -> Command {
|
||||||
let app: Command = Commands::augment_subcommands(Args::command());
|
Commands::augment_subcommands(Args::command())
|
||||||
app.version(env!("JJ_VERSION"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_command(
|
pub fn run_command(
|
||||||
|
@ -15,5 +15,5 @@
|
|||||||
use jujutsu::cli_util::CliRunner;
|
use jujutsu::cli_util::CliRunner;
|
||||||
|
|
||||||
fn main() -> std::process::ExitCode {
|
fn main() -> std::process::ExitCode {
|
||||||
CliRunner::init().run()
|
CliRunner::init().version(env!("JJ_VERSION")).run()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user