Add a clickable link and local time to the issue pretty print
This commit is contained in:
parent
38c571362b
commit
8423cc1240
1 changed files with 22 additions and 3 deletions
|
@ -90,9 +90,28 @@ pub fn display_issues_pretty(issues: &[JiraIssue]) -> Result<(), Box<dyn std::er
|
||||||
writeln!(tw, "{}:\t{}", "Key".blue(), issue.key)?;
|
writeln!(tw, "{}:\t{}", "Key".blue(), issue.key)?;
|
||||||
writeln!(tw, "{}:\t{}", "Summary".blue(), issue.fields.summary)?;
|
writeln!(tw, "{}:\t{}", "Summary".blue(), issue.fields.summary)?;
|
||||||
writeln!(tw, "{}:\t{}", "Status".blue(), issue.fields.status.name)?;
|
writeln!(tw, "{}:\t{}", "Status".blue(), issue.fields.status.name)?;
|
||||||
writeln!(tw, "{}:\t{}", "Created".blue(), issue.fields.created)?;
|
writeln!(
|
||||||
writeln!(tw, "{}:\t{:?}", "Due Date".blue(), issue.fields.due_date)?;
|
tw,
|
||||||
writeln!(tw, "{}:\t{}", "URL".blue(), issue.href.underline())?;
|
"{}:\t{}",
|
||||||
|
"Created".blue(),
|
||||||
|
issue.fields.created.with_timezone(&chrono::Local)
|
||||||
|
)?;
|
||||||
|
writeln!(
|
||||||
|
tw,
|
||||||
|
"{}:\t{}",
|
||||||
|
"Due Date".blue(),
|
||||||
|
match issue.fields.due_date {
|
||||||
|
None => "None".to_string(),
|
||||||
|
Some(x) => x.to_string(),
|
||||||
|
}
|
||||||
|
)?;
|
||||||
|
writeln!(
|
||||||
|
tw,
|
||||||
|
"\u{1b}]8;;{}\u{7}{}\u{1b}]8;;\u{7}",
|
||||||
|
issue.href,
|
||||||
|
"Open Issue".green()
|
||||||
|
)?;
|
||||||
|
|
||||||
tw.flush().unwrap();
|
tw.flush().unwrap();
|
||||||
|
|
||||||
let written = String::from_utf8(tw.into_inner().unwrap()).unwrap();
|
let written = String::from_utf8(tw.into_inner().unwrap()).unwrap();
|
||||||
|
|
Loading…
Reference in a new issue