From 857ecda050b750a9f901f08d4cac8f170a5def99 Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Tue, 4 Jan 2022 14:05:24 +1100 Subject: [PATCH] Let describe know about binary (#662) --- .../nu-command/src/core_commands/describe.rs | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/crates/nu-command/src/core_commands/describe.rs b/crates/nu-command/src/core_commands/describe.rs index b5a988b0c0b2..d10929d4dabc 100644 --- a/crates/nu-command/src/core_commands/describe.rs +++ b/crates/nu-command/src/core_commands/describe.rs @@ -26,13 +26,20 @@ impl Command for Describe { input: PipelineData, ) -> Result { let head = call.head; - input.map( - move |x| Value::String { - val: x.get_type().to_string(), - span: head, - }, - engine_state.ctrlc.clone(), - ) + if matches!(input, PipelineData::ByteStream(..)) { + Ok(PipelineData::Value( + Value::string("binary", call.head), + None, + )) + } else { + input.map( + move |x| Value::String { + val: x.get_type().to_string(), + span: head, + }, + engine_state.ctrlc.clone(), + ) + } } fn examples(&self) -> Vec {