cli: Use `term::Table::header` where possible

This commit is contained in:
Lorenz Leutgeb 2024-09-12 20:42:10 +02:00 committed by cloudhead
parent bcba8f5a21
commit f58af8fef4
No known key found for this signature in database
7 changed files with 7 additions and 7 deletions

View File

@ -141,7 +141,7 @@ pub fn following(profile: &Profile, alias: Option<Alias>) -> anyhow::Result<()>
let store = profile.policies()?;
let aliases = profile.aliases();
let mut t = term::Table::new(term::table::TableOptions::bordered());
t.push([
t.header([
term::format::default(String::from("DID")),
term::format::default(String::from("Alias")),
term::format::default(String::from("Policy")),

View File

@ -521,7 +521,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
let mut revisions =
term::Table::<7, term::Label>::new(term::table::TableOptions::bordered());
revisions.push([
revisions.header([
term::format::dim(String::from("")).into(),
term::format::bold(String::from("ID")).into(),
term::format::bold(String::from("Title")).into(),

View File

@ -682,7 +682,7 @@ where
});
let mut table = term::Table::new(term::table::TableOptions::bordered());
table.push([
table.header([
term::format::dim(String::from("")).into(),
term::format::bold(String::from("ID")).into(),
term::format::bold(String::from("Title")).into(),

View File

@ -148,7 +148,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
if rows.is_empty() {
term::print(term::format::italic("Nothing to show."));
} else {
table.push([
table.header([
"Name".into(),
"RID".into(),
"Visibility".into(),

View File

@ -254,7 +254,7 @@ pub fn sessions(node: &Node) -> Result<Option<term::Table<4, term::Label>>, node
let mut table = term::Table::new(term::table::TableOptions::bordered());
let now = LocalTime::now();
table.push([
table.header([
term::format::bold("Peer").into(),
term::format::bold("Address").into(),
term::format::bold("State").into(),

View File

@ -56,7 +56,7 @@ pub fn run(
..TableOptions::default()
});
table.push([
table.header([
term::format::dim(String::from("")).into(),
term::format::bold(String::from("ID")).into(),
term::format::bold(String::from("Title")).into(),

View File

@ -321,7 +321,7 @@ fn sync_status(
let local_nid = node.nid()?;
let aliases = profile.aliases();
table.push([
table.header([
term::format::dim(String::from("")).into(),
term::format::bold(String::from("Node")).into(),
term::Label::blank(),