diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-12-24 15:04:28 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-12-24 15:04:28 +0800 |
| commit | cc4bef746adda6cc48ddf93f113847b88a4e185d (patch) | |
| tree | 06277da74b3ec9b7a4d228e56451106d1cb4c104 /src | |
| parent | e9be7886fab598776f7ac6e7217e7c546431e05c (diff) | |
Add core version info to CLI version output
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/jv.rs | 19 | ||||
| -rw-r--r-- | src/bin/jvv.rs | 8 |
2 files changed, 23 insertions, 4 deletions
diff --git a/src/bin/jv.rs b/src/bin/jv.rs index 4397e17..29b2c36 100644 --- a/src/bin/jv.rs +++ b/src/bin/jv.rs @@ -1,5 +1,6 @@ use colored::Colorize; use just_enough_vcs::{ + data::compile_info::CoreCompileInfo, system::action_system::{action::ActionContext, action_pool::ActionPool}, utils::{ cfg_file::config::ConfigFile, @@ -880,10 +881,15 @@ async fn main() { match parser.command { JustEnoughVcsWorkspaceCommand::Version(version_args) => { let compile_info = CompileInfo::default(); + let core_compile_info = CoreCompileInfo::default(); if version_args.without_banner { println!( "{}", - md(t!("jv.version.header", version = compile_info.cli_version)) + md(t!( + "jv.version.header", + version = compile_info.cli_version, + vcs_version = core_compile_info.vcs_version + )) ); } else { println!(); @@ -903,12 +909,19 @@ async fn main() { "{banner_line_2}", &format!( "{}: {} ({})", - t!("common.word.version"), + t!("common.word.cli_version"), &compile_info.cli_version, &compile_info.date ) ) - .replace("{banner_line_3}", "") + .replace( + "{banner_line_3}", + &format!( + "{}: {}", + t!("common.word.vcs_version"), + &core_compile_info.vcs_version + ) + ) ); if !version_args.compile_info { diff --git a/src/bin/jvv.rs b/src/bin/jvv.rs index 644a576..ee8cae8 100644 --- a/src/bin/jvv.rs +++ b/src/bin/jvv.rs @@ -1,5 +1,6 @@ use clap::{Parser, Subcommand}; use just_enough_vcs::{ + data::compile_info::CoreCompileInfo, utils::{ cfg_file::config::ConfigFile, string_proc::{self, pascal_case}, @@ -202,9 +203,14 @@ async fn main() { match parser.command { JustEnoughVcsVaultCommand::Version(version_args) => { let compile_info = CompileInfo::default(); + let core_compile_info = CoreCompileInfo::default(); println!( "{}", - md(t!("jvv.version.header", version = compile_info.cli_version)) + md(t!( + "jvv.version.header", + version = compile_info.cli_version, + vcs_version = core_compile_info.vcs_version + )) ); if version_args.compile_info { |
