From 61544eecd6388fcea5b40861503f000e23ca1ab0 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Tue, 3 Sep 2024 12:46:36 -0500 Subject: [PATCH] add version and path to plugin executable help (#13764) # Description This change allows one to see the version of their plugin file without trying to register it. ![image](https://github.com/user-attachments/assets/9f1ddbd7-f63f-47f7-87c8-0d839f5e4b1f) # User-Facing Changes # Tests + Formatting # After Submitting --- crates/nu-plugin/src/plugin/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/nu-plugin/src/plugin/mod.rs b/crates/nu-plugin/src/plugin/mod.rs index 340d55e3b91c..c5af681f5eae 100644 --- a/crates/nu-plugin/src/plugin/mod.rs +++ b/crates/nu-plugin/src/plugin/mod.rs @@ -655,6 +655,15 @@ fn print_help(plugin: &impl Plugin, encoder: impl PluginEncoder) { println!("Nushell Plugin"); println!("Encoder: {}", encoder.name()); + println!("Version: {}", plugin.version()); + + // Determine the plugin name + let exe = std::env::current_exe().ok(); + let plugin_name: String = exe + .as_ref() + .map(|stem| stem.to_string_lossy().into_owned()) + .unwrap_or_else(|| "(unknown)".into()); + println!("Plugin file path: {}", plugin_name); let mut help = String::new(); let help_style = HelpStyle::default();