minor changes to task display

This commit is contained in:
aaron-jack-manning 2022-08-21 11:48:30 +10:00
parent 973f316bc0
commit 2ed43ea6d4

View File

@ -208,15 +208,21 @@ impl Task {
println!("Tags: [{}]", format_hash_set(&self.data.tags)?); println!("Tags: [{}]", format_hash_set(&self.data.tags)?);
println!("Created: {}", self.data.created); println!("Created: {}", self.data.created);
let mut max_line_width = 0;
if let Some(info) = &self.data.info { if let Some(info) = &self.data.info {
println!("Info:"); println!("Info:");
// Figure out how to indent this properly: let info_lines : Vec<&str> = info.split("\n").collect();
println!("\t{}", info); for line in info_lines {
max_line_width = usize::max(max_line_width, line.chars().count() + 4);
println!(" {}", line);
}
} }
Ok(()) line(usize::min(max_line_width, usize::try_from(termsize::get().map(|s| s.cols).unwrap_or(0)).unwrap()));
// dependencies as a tree // dependencies as a tree
Ok(())
} }
} }