Let describe know about binary (#662)

This commit is contained in:
JT 2022-01-04 14:05:24 +11:00 committed by GitHub
parent 36079f1a3d
commit 857ecda050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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> {