mirror of
https://github.com/nushell/nushell
synced 2025-01-15 14:44:14 +00:00
tweak version output as a list vs table (#472)
This commit is contained in:
parent
7cbeebaac1
commit
f8e6620e48
2 changed files with 32 additions and 31 deletions
18
Cargo.lock
generated
18
Cargo.lock
generated
|
@ -1209,6 +1209,12 @@ version = "1.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb"
|
checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is_debug"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "06d198e9919d9822d5f7083ba8530e04de87841eaf21ead9af8f2304efd57c89"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itertools"
|
name = "itertools"
|
||||||
version = "0.10.3"
|
version = "0.10.3"
|
||||||
|
@ -1684,6 +1690,7 @@ dependencies = [
|
||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"serde_yaml",
|
"serde_yaml",
|
||||||
"sha2",
|
"sha2",
|
||||||
|
"shadow-rs",
|
||||||
"strip-ansi-escapes",
|
"strip-ansi-escapes",
|
||||||
"sysinfo",
|
"sysinfo",
|
||||||
"terminal_size",
|
"terminal_size",
|
||||||
|
@ -2714,6 +2721,17 @@ dependencies = [
|
||||||
"digest",
|
"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]]
|
[[package]]
|
||||||
name = "signal-hook"
|
name = "signal-hook"
|
||||||
version = "0.3.12"
|
version = "0.3.12"
|
||||||
|
|
|
@ -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
|
// Get a list of command names and check for plugins
|
||||||
let installed_plugins = engine_state
|
let installed_plugins = engine_state
|
||||||
.plugin_decls()
|
.plugin_decls()
|
||||||
|
@ -232,13 +207,21 @@ pub fn version(
|
||||||
let cols = indexmap.keys().cloned().collect::<Vec<_>>();
|
let cols = indexmap.keys().cloned().collect::<Vec<_>>();
|
||||||
let vals = indexmap.values().cloned().collect::<Vec<_>>();
|
let vals = indexmap.values().cloned().collect::<Vec<_>>();
|
||||||
|
|
||||||
Ok(Value::List {
|
// Ok(Value::List {
|
||||||
vals: vec![Value::Record {
|
// 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,
|
cols,
|
||||||
vals,
|
vals,
|
||||||
span: Span::unknown(),
|
span: Span::unknown(),
|
||||||
}],
|
|
||||||
span: Span::unknown(),
|
|
||||||
}
|
}
|
||||||
.into_pipeline_data())
|
.into_pipeline_data())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue