summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2025-12-24 15:04:28 +0800
committer魏曹先生 <1992414357@qq.com>2025-12-24 15:04:28 +0800
commitcc4bef746adda6cc48ddf93f113847b88a4e185d (patch)
tree06277da74b3ec9b7a4d228e56451106d1cb4c104
parente9be7886fab598776f7ac6e7217e7c546431e05c (diff)
Add core version info to CLI version output
-rw-r--r--Cargo.lock2
-rw-r--r--locales/help_docs/en.yml6
-rw-r--r--locales/help_docs/zh-CN.yml6
-rw-r--r--src/bin/jv.rs19
-rw-r--r--src/bin/jvv.rs8
5 files changed, 33 insertions, 8 deletions
diff --git a/Cargo.lock b/Cargo.lock
index e732e29..a2c65be 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -971,10 +971,12 @@ version = "0.0.0"
dependencies = [
"action_system",
"cfg_file",
+ "chrono",
"data_struct",
"sha1_hash",
"string_proc",
"tcp_connection",
+ "toml 0.9.8",
"vcs_actions",
"vcs_data",
"vcs_docs",
diff --git a/locales/help_docs/en.yml b/locales/help_docs/en.yml
index 70b0b1c..a5a9fb0 100644
--- a/locales/help_docs/en.yml
+++ b/locales/help_docs/en.yml
@@ -30,11 +30,13 @@ common:
word:
version: Version
+ cli_version: CLI Version
+ vcs_version: VCS Version
jvv:
version:
header: |
- JVCS Upstream Manager - %{version}
+ JVCS Upstream Manager - %{version} (Core: [[cyan]]%{vcs_version}[[/]])
compile_info: |
Compile Info
@@ -192,7 +194,7 @@ jvv:
jv:
version:
header: |
- JustEnoughVCS - [[cyan]]%{version}[[/]]
+ JVCS CommandLine - [[cyan]]%{version}[[/]] (Core: [[cyan]]%{vcs_version}[[/]])
compile_info: |
Compile Info
diff --git a/locales/help_docs/zh-CN.yml b/locales/help_docs/zh-CN.yml
index a93aab6..dc00606 100644
--- a/locales/help_docs/zh-CN.yml
+++ b/locales/help_docs/zh-CN.yml
@@ -30,11 +30,13 @@ common:
word:
version: 版本
+ cli_version: 命令行版本
+ vcs_version: 核心库版本
jvv:
version:
header: |
- JVCS 上游管理工具 - %{version}
+ JVCS 上游管理工具 - %{version}(核心:[[cyan]]%{vcs_version}[[/]])
compile_info: |
编译信息:
@@ -187,7 +189,7 @@ jvv:
jv:
version:
header: |
- JustEnoughVCS - [[cyan]]%{version}[[/]]
+ JVCS 命令行工具 - [[cyan]]%{version}[[/]](核心:[[cyan]]%{vcs_version}[[/]])
compile_info: |
编译信息:
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 {