Skip to content

A rust library to format the output of cli programs

License

Notifications You must be signed in to change notification settings

loenard97/cliform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages