cli/id: Add verbose output to show and list

This commit is contained in:
Adrian Duke
2026-08-04 19:34:56 +02:00
committed by Lorenz Leutgeb
parent c830053e32
commit ca1b4fa7bc
2 changed files with 19 additions and 13 deletions
+14 -13
View File
@@ -241,26 +241,27 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
identity::State::Redacted(_) => continue,
}
.into();
let id = term::format::oid(r.id).into();
let id = if args.verbose {
term::label(r.id.to_string())
} else {
term::format::oid(r.id).into()
};
let title = term::label(r.title.to_string());
let (alias, author) =
term::format::Author::new(r.author.public_key(), &profile, true).labels();
let timestamp = term::format::timestamp(r.timestamp).into();
let parent = r
.parent
.map(term::format::oid)
.unwrap_or_else(|| term::Paint::new("none".to_string()));
.map(|p| {
if args.verbose {
term::label(p.to_string())
} else {
term::format::oid(p).into()
}
})
.unwrap_or_else(|| term::Paint::new("none".to_string()).into());
revisions.push([
icon,
id,
title,
alias,
author,
state,
timestamp,
parent.into(),
]);
revisions.push([icon, id, title, alias, author, state, timestamp, parent]);
}
revisions.print();
@@ -111,6 +111,11 @@ pub struct Args {
#[arg(long, short)]
#[arg(global = true)]
pub(super) quiet: bool,
/// Print full OIDs instead of abbreviated ones
#[arg(long, short)]
#[arg(global = true)]
pub(super) verbose: bool,
}
impl Args {