loenard97 / cliform

A rust library to format the output of cli programs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A rust library to format the output of cli programs

License:Open Software License 3.0


Languages

Language:Rust 100.0%