forked from extern/nushell
Let describe know about binary (#662)
This commit is contained in:
parent
36079f1a3d
commit
857ecda050
@ -26,13 +26,20 @@ impl Command for Describe {
|
|||||||
input: PipelineData,
|
input: PipelineData,
|
||||||
) -> Result<PipelineData, ShellError> {
|
) -> Result<PipelineData, ShellError> {
|
||||||
let head = call.head;
|
let head = call.head;
|
||||||
input.map(
|
if matches!(input, PipelineData::ByteStream(..)) {
|
||||||
move |x| Value::String {
|
Ok(PipelineData::Value(
|
||||||
val: x.get_type().to_string(),
|
Value::string("binary", call.head),
|
||||||
span: head,
|
None,
|
||||||
},
|
))
|
||||||
engine_state.ctrlc.clone(),
|
} else {
|
||||||
)
|
input.map(
|
||||||
|
move |x| Value::String {
|
||||||
|
val: x.get_type().to_string(),
|
||||||
|
span: head,
|
||||||
|
},
|
||||||
|
engine_state.ctrlc.clone(),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
|
Loading…
Reference in New Issue
Block a user