diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-01-07 19:04:41 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-01-07 19:04:41 +0800 |
| commit | 81ea89384eb4cfda14518a6ccb439d97399ad74f (patch) | |
| tree | d7a7d3c90953574fa09d548ac6b93ae6e1ddfcc2 /src/output/info.rs | |
| parent | 6e18bb52bcf50e53c1d130a17d0143d671b64ab0 (diff) | |
Add JSON output support for multiple commands
- Add serde and serde_json dependencies
- Add JSON output modules for accounts, align, analyzer, here, info, and
sheets
- Add --json and --pretty flags to sheet list, sheet align, here,
status, info, and account list commands
- Implement JSON serialization for here command output
- Update command argument structs to include JSON output options
Diffstat (limited to 'src/output/info.rs')
| -rw-r--r-- | src/output/info.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/output/info.rs b/src/output/info.rs new file mode 100644 index 0000000..8948980 --- /dev/null +++ b/src/output/info.rs @@ -0,0 +1,24 @@ +use just_enough_vcs::vcs::data::{ + member::MemberId, + vault::virtual_file::{VirtualFileId, VirtualFileVersion}, +}; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Default, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct InfoJsonResult { + pub mapping: String, + pub in_ref: String, + pub vfid: VirtualFileId, + pub histories: Vec<InfoHistory>, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct InfoHistory { + pub version: VirtualFileVersion, + pub version_creator: MemberId, + pub version_description: String, + pub is_current_version: bool, + pub is_ref_version: bool, +} |
