cli: Lightly document terminal::Table

Help developers by giving a small description and example for its use.

Signed-off-by: Slack Coder <slackcoder@server.ky>
This commit is contained in:
Slack Coder 2022-12-21 08:20:18 -05:00 committed by Alexis Sellier
parent 873ce895ae
commit c0590a100d
No known key found for this signature in database
1 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,19 @@
//! Print column-aligned text to the console.
//!
//! Example:
//! ```
//! use radicle_cli::terminal::table::*;
//!
//! let mut t = Table::new(TableOptions::default());
//! t.push(["pest".to_string(), "biological control".to_string()]);
//! t.push(["aphid".to_string(), "lacewing".to_string()]);
//! t.push(["spider mite".to_string(), "ladybug".to_string()]);
//! t.render();
//! // pest biological control
//! // aphid lacewing
//! // spider mite ladybug
//! ```
use std::fmt::Write;
use crate::terminal as term;