| 1 | use comfy_table::{Cell, ContentArrangement, Row, Table}; |
| 2 | |
| 3 | fn main() { |
| 4 | let mut table = Table::new(); |
| 5 | //table.load_preset(comfy_table::presets::NOTHING); |
| 6 | table.set_content_arrangement(ContentArrangement::Dynamic); |
| 7 | table.set_width(85); |
| 8 | |
| 9 | let mut row = Row::new(); |
| 10 | row.add_cell(Cell::new(format!( |
| 11 | "List of devices:\n{}", |
| 12 | console::style("Blockdevices\nCryptdevices").dim().blue() |
| 13 | ))); |
| 14 | row.add_cell(Cell::new("")); |
| 15 | |
| 16 | table.add_row(row); |
| 17 | |
| 18 | let mut row = Row::new(); |
| 19 | row.add_cell(Cell::new(format!( |
| 20 | "Block devices: \n/dev/{}\n/dev/{}", |
| 21 | console::style("sda1").bold().red(), |
| 22 | console::style("sda2").bold().red() |
| 23 | ))); |
| 24 | row.add_cell(Cell::new("These are some block devices that were found.")); |
| 25 | table.add_row(row); |
| 26 | |
| 27 | let mut row = Row::new(); |
| 28 | row.add_cell(Cell::new(format!( |
| 29 | "Crypt devices: \n/dev/mapper/{}", |
| 30 | console::style("cryptroot").bold().yellow() |
| 31 | ))); |
| 32 | row.add_cell(Cell::new("This one seems to be encrypted.")); |
| 33 | table.add_row(row); |
| 34 | |
| 35 | println!("{}", table); |
| 36 | } |