From 2dd4cb9f7d9b8b3e741c9178bce12bb881271615 Mon Sep 17 00:00:00 2001 From: Leon Date: Sat, 19 Nov 2022 06:33:01 +1000 Subject: [PATCH] Improve "Cannot convert argument to string" msg (#7161) --- crates/nu-command/src/system/run_external.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/system/run_external.rs b/crates/nu-command/src/system/run_external.rs index f91c139be..dd474c334 100644 --- a/crates/nu-command/src/system/run_external.rs +++ b/crates/nu-command/src/system/run_external.rs @@ -64,7 +64,7 @@ impl Command for External { .map(|item| Spanned { item, span }) .map_err(|_| { ShellError::ExternalCommand( - "Cannot convert argument to a string".into(), + format!("Cannot convert {} to a string", value.get_type()), "All arguments to an external command need to be string-compatible".into(), span, ) @@ -267,7 +267,7 @@ impl ExternalCommand { Some(s) => { if reconfirm_command_name { format!( - "'{}' was not found, did you mean '{s}'?", + "'{}' was not found; did you mean '{s}'?", self.name.item ) } else if self.name.item == s {