From 3a073b419c0093e5b412d8535c1451e730b1c26d Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Thu, 29 Sep 2022 00:41:25 +0900 Subject: [PATCH] Remove First Timestamp and Last Timestamp with -d option (-L option) #707 - 1. [x] Unified output one table with -M/-L and -d option - 2. [x] add channel column to table output - 3. [x] Remove First Timestamp and Last Timestamp with -d option (-M / -L option) - 4. [] Output csv with -o and -M / -L option - 5. [x] Separete two column Count and Percent - 6. [x] change table format output crate from prettytable-rs to comfy_table. --- src/timeline/timelines.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/timeline/timelines.rs b/src/timeline/timelines.rs index bab366b7..2a43bc03 100644 --- a/src/timeline/timelines.rs +++ b/src/timeline/timelines.rs @@ -78,12 +78,15 @@ impl Timeline { } // 出力メッセージ作成 let mut sammsges: Vec = Vec::new(); - sammsges.push("---------------------------------------".to_string()); - sammsges.push(format!("Evtx File Path: {}", self.stats.filepath)); - sammsges.push(format!("Total Event Records: {}\n", self.stats.total)); - sammsges.push(format!("First Timestamp: {}", self.stats.start_time)); - sammsges.push(format!("Last Timestamp: {}\n", self.stats.end_time)); - sammsges.push("---------------------------------------".to_string()); + let total_event_record = format!("\nTotal Event Records: {}\n", self.stats.total); + if CONFIG.read().unwrap().args.filepath.is_some() { + sammsges.push(format!("Evtx File Path: {}", self.stats.filepath)); + sammsges.push(total_event_record); + sammsges.push(format!("First Timestamp: {}", self.stats.start_time)); + sammsges.push(format!("Last Timestamp: {}\n", self.stats.end_time)); + } else { + sammsges.push(total_event_record); + } for msgprint in sammsges.iter() { println!("{}", msgprint); }