Skip to content

Commit

Permalink
Let describe know about binary (nushell#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiajt committed Jan 4, 2022
1 parent 36079f1 commit 857ecda
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions crates/nu-command/src/core_commands/describe.rs
Expand Up @@ -26,13 +26,20 @@ impl Command for Describe {
input: PipelineData,
) -> Result<PipelineData, ShellError> {
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<Example> {
Expand Down

0 comments on commit 857ecda

Please sign in to comment.