feat: separate output columns by tabulator

This commit is contained in:
xeruf 2024-07-24 16:14:19 +03:00
parent b30994c151
commit f3110564cd
2 changed files with 3 additions and 2 deletions

View File

@ -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::<Vec<String>>())),
"desc" | "description" => self.descriptions().fold(None, |total, s| {
Some(match total {
None => s,

View File

@ -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::<Vec<String>>()
.join(" ")
.join("\t")
);
}
println!();