cliform

Crates.iocliform
lib.rscliform
version0.1.0
sourcesrc
created_at2023-07-15 08:12:00.955604
updated_at2023-07-15 08:12:00.955604
descriptionA simple way to format the output of your cli application.
homepagehttps://github.com/loenard97/cliform
repositoryhttps://github.com/loenard97/cliform
max_upload_size
id917049
size21,146
Dennis Lönard (loenard97)

documentation

README

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
Commit count: 7

cargo fmt