Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Lightly document terminal::Table
Slack Coder committed 3 years ago
commit c0590a100dac4383fafc55f7571890f44c727983
parent 873ce895ae0110ed9055a537f03f9b0455baff1c
1 file changed +16 -0
modified radicle-cli/src/terminal/table.rs
@@ -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;