cliform 0.1.0

A simple way to format the output of your cli application.
Documentation
  • Coverage
  • 0%
    0 out of 7 items documented0 out of 0 items with examples
  • Size
  • Source code size: 20.81 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.99 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • loenard97/cliform
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • loenard97

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