From f3110564cd2fc9ef4ed6a2e789db2f66c021574a Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Wed, 24 Jul 2024 16:14:19 +0300 Subject: [PATCH] feat: separate output columns by tabulator --- src/task.rs | 1 + src/tasks.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/task.rs b/src/task.rs index f73ff8a..41e1229 100644 --- a/src/task.rs +++ b/src/task.rs @@ -100,6 +100,7 @@ impl Task { "state" => self.state().map(|s| s.to_string()), "name" => Some(self.event.content.clone()), "time" => Some(self.time_tracked().to_string()), // TODO: format properly + "props" => Some(format!("{:?}", self.props.iter().map(|e| format!("{} kind {} '{}'", e.created_at, e.kind, e.content)).collect::>())), "desc" | "description" => self.descriptions().fold(None, |total, s| { Some(match total { None => s, diff --git a/src/tasks.rs b/src/tasks.rs index 462f207..ecf349d 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -66,7 +66,7 @@ impl Tasks { } pub(crate) fn print_current_tasks(&self) { - println!("{}", self.properties.join(" ")); + println!("{}", self.properties.join("\t")); for task in self.current_tasks() { println!( "{}", @@ -78,7 +78,7 @@ impl Tasks { prop => task.get(prop).unwrap_or(String::new()), }) .collect::>() - .join(" ") + .join("\t") ); } println!();