From d89d1894d0f29e545d6cf80b4d5da11799c92060 Mon Sep 17 00:00:00 2001 From: Leon Date: Sun, 20 Nov 2022 15:46:13 +1000 Subject: [PATCH] Add missing legacy support for config.table_index_mode. (#7170) --- crates/nu-protocol/src/config.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/nu-protocol/src/config.rs b/crates/nu-protocol/src/config.rs index f049ceb80d..08c9c7eae0 100644 --- a/crates/nu-protocol/src/config.rs +++ b/crates/nu-protocol/src/config.rs @@ -754,6 +754,22 @@ impl Value { eprintln!("$env.config.table_mode is not a string") } } + "table_index_mode" => { + legacy_options_used = true; + if let Ok(b) = value.as_string() { + let val_str = b.to_lowercase(); + match val_str.as_ref() { + "always" => config.table_index_mode = TableIndexMode::Always, + "never" => config.table_index_mode = TableIndexMode::Never, + "auto" => config.table_index_mode = TableIndexMode::Auto, + _ => eprintln!( + "unrecognized $env.config.table_index_mode '{val_str}'; expected either 'never', 'always' or 'auto'" + ), + } + } else { + eprintln!("$env.config.table_index_mode is not a string") + } + } "table_trim" => { legacy_options_used = true; config.trim_strategy = try_parse_trim_strategy(value, &config)?