From 7c0a52a81e132457bc1a8d53f7c10cd536d0c5fb Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Mon, 21 Jun 2021 14:14:20 -0500 Subject: [PATCH] updated `main` in table so that it outputs again (#3662) --- crates/nu-table/.gitignore | 22 ++++++++++++++++++++++ crates/nu-table/src/main.rs | 5 +++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 crates/nu-table/.gitignore diff --git a/crates/nu-table/.gitignore b/crates/nu-table/.gitignore new file mode 100644 index 000000000..4c234e523 --- /dev/null +++ b/crates/nu-table/.gitignore @@ -0,0 +1,22 @@ +/target +/scratch +**/*.rs.bk +history.txt +tests/fixtures/nuplayground +crates/*/target + +# Debian/Ubuntu +debian/.debhelper/ +debian/debhelper-build-stamp +debian/files +debian/nu.substvars +debian/nu/ + +# macOS junk +.DS_Store + +# JetBrains' IDE items +.idea/* + +# VSCode's IDE items +.vscode/* diff --git a/crates/nu-table/src/main.rs b/crates/nu-table/src/main.rs index 36fe20528..16c214db9 100644 --- a/crates/nu-table/src/main.rs +++ b/crates/nu-table/src/main.rs @@ -23,11 +23,12 @@ fn main() { let rows = vec_of_str_to_vec_of_styledstr(&row_data, false); // The table itself let table = Table::new(headers, vec![rows; 3], Theme::rounded()); - // FIXME: Config isn't available from here so just put these here to compile let color_hm: HashMap = HashMap::new(); + // Capture the table as a string + let output_table = draw_table(&table, width, &color_hm); // Draw the table - draw_table(&table, width, &color_hm); + println!("{}", output_table) } fn make_table_data() -> (Vec<&'static str>, Vec<&'static str>) {