diff --git a/crates/nu-table/src/main.rs b/crates/nu-table/src/main.rs index cb0f0ef45a..f7bf1e11bf 100644 --- a/crates/nu-table/src/main.rs +++ b/crates/nu-table/src/main.rs @@ -3,9 +3,18 @@ use std::collections::HashMap; fn main() { let args: Vec<_> = std::env::args().collect(); + let mut width = 0; + + if args.len() > 1 { + // Width in terminal characters + width = args[1].parse::().expect("Need a width in columns"); + } + + if width < 4 { + println!("Width must be greater than or equal to 4, setting width to 80"); + width = 80; + } - // Width in terminal characters - let width = args[1].parse::().expect("Need a width in columns"); // The mocked up table data let (table_headers, row_data) = make_table_data(); // The table headers