generated from PlexSheep/baserepo
implement a cli module #85
|
@ -45,7 +45,7 @@ pub fn blockfmt(content: impl ToString, color: Color) -> String {
|
||||||
color,
|
color,
|
||||||
presets::UTF8_BORDERS_ONLY,
|
presets::UTF8_BORDERS_ONLY,
|
||||||
ContentArrangement::DynamicFullWidth,
|
ContentArrangement::DynamicFullWidth,
|
||||||
CellAlignment::Center
|
CellAlignment::Center,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,17 +89,14 @@ pub fn blockfmt_advanced(
|
||||||
color: Color,
|
color: Color,
|
||||||
preset: &str,
|
preset: &str,
|
||||||
arrangement: ContentArrangement,
|
arrangement: ContentArrangement,
|
||||||
alignment: CellAlignment
|
alignment: CellAlignment,
|
||||||
) -> String {
|
) -> String {
|
||||||
let mut table = Table::new();
|
let mut table = Table::new();
|
||||||
table
|
table
|
||||||
.load_preset(preset)
|
.load_preset(preset)
|
||||||
.set_content_arrangement(arrangement)
|
.set_content_arrangement(arrangement)
|
||||||
.add_row(vec![content.to_string()]);
|
.add_row(vec![content.to_string()]);
|
||||||
table
|
table.column_mut(0).unwrap().set_cell_alignment(alignment);
|
||||||
.column_mut(0)
|
|
||||||
.unwrap()
|
|
||||||
.set_cell_alignment(alignment);
|
|
||||||
|
|
||||||
format!("{}", style(table).fg(color))
|
format!("{}", style(table).fg(color))
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue