mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 23:06:45 +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
3 changed files with 8 additions and 3 deletions
|
@ -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.
|
||||
pub fn set_store_factories(mut self, store_factories: StoreFactories) -> Self {
|
||||
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 {
|
||||
let app: Command = Commands::augment_subcommands(Args::command());
|
||||
app.version(env!("JJ_VERSION"))
|
||||
Commands::augment_subcommands(Args::command())
|
||||
}
|
||||
|
||||
pub fn run_command(
|
||||
|
|
|
@ -15,5 +15,5 @@
|
|||
use jujutsu::cli_util::CliRunner;
|
||||
|
||||
fn main() -> std::process::ExitCode {
|
||||
CliRunner::init().run()
|
||||
CliRunner::init().version(env!("JJ_VERSION")).run()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue