From f8e6620e4858b33155797b9bdb4d25eb89930297 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Sat, 11 Dec 2021 14:40:16 -0600 Subject: [PATCH] tweak version output as a list vs table (#472) --- Cargo.lock | 18 ++++++++ .../nu-command/src/core_commands/version.rs | 45 ++++++------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46d1ace3eb..856f4ddcc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1209,6 +1209,12 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" +[[package]] +name = "is_debug" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06d198e9919d9822d5f7083ba8530e04de87841eaf21ead9af8f2304efd57c89" + [[package]] name = "itertools" version = "0.10.3" @@ -1684,6 +1690,7 @@ dependencies = [ "serde_urlencoded", "serde_yaml", "sha2", + "shadow-rs", "strip-ansi-escapes", "sysinfo", "terminal_size", @@ -2714,6 +2721,17 @@ dependencies = [ "digest", ] +[[package]] +name = "shadow-rs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8935e920eb80ff8f5a5bced990325d12f6cc1015154a3852c6a23cf5bd71c447" +dependencies = [ + "chrono", + "git2", + "is_debug", +] + [[package]] name = "signal-hook" version = "0.3.12" diff --git a/crates/nu-command/src/core_commands/version.rs b/crates/nu-command/src/core_commands/version.rs index dd4d98bb6a..98280b740c 100644 --- a/crates/nu-command/src/core_commands/version.rs +++ b/crates/nu-command/src/core_commands/version.rs @@ -188,31 +188,6 @@ pub fn version( }, ); - // Manually create a list of all possible plugin names - // Don't think we need this anymore. Leaving it here, just in case we do actually need it. - // let all_plugins = vec![ - // "fetch", - // "inc", - // "match", - // "post", - // "ps", - // "sys", - // "textview", - // "binaryview", - // "chart bar", - // "chart line", - // "from bson", - // "from sqlite", - // "query json", - // "s3", - // "selector", - // "start", - // "to bson", - // "to sqlite", - // "tree", - // "xpath", - // ]; - // Get a list of command names and check for plugins let installed_plugins = engine_state .plugin_decls() @@ -232,12 +207,20 @@ pub fn version( let cols = indexmap.keys().cloned().collect::>(); let vals = indexmap.values().cloned().collect::>(); - Ok(Value::List { - vals: vec![Value::Record { - cols, - vals, - span: Span::unknown(), - }], + // Ok(Value::List { + // vals: vec![Value::Record { + // cols, + // vals, + // span: Span::unknown(), + // }], + // span: Span::unknown(), + // } + // .into_pipeline_data()) + + // List looks better than table, imo + Ok(Value::Record { + cols, + vals, span: Span::unknown(), } .into_pipeline_data())