#console #terminal #output #format #cli #programs #grid

cliform

A simple way to format the output of your cli application

1 unstable release

0.1.0 Jul 15, 2023

#96 in #grid

OSL-3.0 license

11KB
311 lines

cliform

A rust library to format the output of cli programs

▶️ Usage

Grid

let grid = Grid::new();
grid.push("Hello");
grid.push("World");
grid.push("!");

println!("{}", grid.to_string());
Hello  World  !

Table

let mut table = Table::new();
table.header(vec!["first", "second", "third"]);
table.push(vec!["Hello", "World", "!"]);
table.push(vec!["How", "are", "you?"]):
table.push(vec!["Great", "weather", "right?"]);

println!("{}", table.to_string());
first    second   third
───────────────────────────
Hello    World    !
How      are      you?
Great    weather  right?

Tree

let tree = Tree::new();
tree.push("first", 0);
tree.push("second", 1);
tree.push("third", 1);

println!("{}", tree.to_string());
├─ first
  ├─ second
  └─ third

No runtime deps