From 53e35670eaf1987f7a8db2803d788726af4cb661 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Thu, 12 May 2022 07:27:44 -0500 Subject: [PATCH] add the ability to change table mode when running script (#5520) --- crates/nu-cli/src/commands.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/nu-cli/src/commands.rs b/crates/nu-cli/src/commands.rs index 65093dcc21..6447a1ed0f 100644 --- a/crates/nu-cli/src/commands.rs +++ b/crates/nu-cli/src/commands.rs @@ -21,6 +21,12 @@ pub fn evaluate_commands( ) -> Result<()> { // Run a command (or commands) given to us by the user let (block, delta) = { + if let Some(ref t_mode) = table_mode { + let mut config = engine_state.get_config().clone(); + config.table_mode = t_mode.as_string()?; + engine_state.set_config(&config); + } + let mut working_set = StateWorkingSet::new(engine_state); let (output, err) = parse(&mut working_set, None, commands.item.as_bytes(), false, &[]);