mirror of
https://github.com/nushell/nushell.git
synced 2025-01-11 16:58:41 +01:00
add list of installed plugins to version command (#3548)
This commit is contained in:
parent
8b193db0cb
commit
13257004bc
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -827,7 +827,7 @@ checksum = "e68bbd985a63de680ab4d1ad77b6306611a8f961b282c8b5ab513e6de934e396"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"libc",
|
"libc",
|
||||||
"serde 1.0.125",
|
"serde 1.0.126",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -2137,7 +2137,7 @@ dependencies = [
|
|||||||
"proc-macro-hack",
|
"proc-macro-hack",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote 1.0.9",
|
"quote 1.0.9",
|
||||||
"syn 1.0.71",
|
"syn 1.0.72",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -140,6 +140,43 @@ pub fn version(args: CommandArgs) -> Result<ActionStream, ShellError> {
|
|||||||
features_enabled().join(", ").to_string_value_create_tag(),
|
features_enabled().join(", ").to_string_value_create_tag(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Manually create a list of all possible plugin names
|
||||||
|
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 = args
|
||||||
|
.scope()
|
||||||
|
.get_command_names()
|
||||||
|
.into_iter()
|
||||||
|
.filter(|cmd| all_plugins.contains(&cmd.as_str()))
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
indexmap.insert(
|
||||||
|
"installed_plugins".to_string(),
|
||||||
|
installed_plugins.join(", ").to_string_value_create_tag(),
|
||||||
|
);
|
||||||
|
|
||||||
let value = UntaggedValue::Row(Dictionary::from(indexmap)).into_value(&tag);
|
let value = UntaggedValue::Row(Dictionary::from(indexmap)).into_value(&tag);
|
||||||
Ok(ActionStream::one(value))
|
Ok(ActionStream::one(value))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user