forked from extern/nushell
parent
1843fdc060
commit
2b955f82b7
@ -53,6 +53,14 @@ impl Command for First {
|
|||||||
span: Span::test_data(),
|
span: Span::test_data(),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
Example {
|
||||||
|
description: "Return the first 2 items of a bytes",
|
||||||
|
example: "0x[01 23 45] | first 2",
|
||||||
|
result: Some(Value::Binary {
|
||||||
|
val: vec![0x01, 0x23],
|
||||||
|
span: Span::test_data(),
|
||||||
|
}),
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,10 +161,7 @@ fn first_helper(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(ShellError::UnsupportedInput(
|
Ok(PipelineData::new(head).set_metadata(metadata))
|
||||||
String::from("Cannot perform into string on empty input"),
|
|
||||||
head,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Loading…
Reference in New Issue
Block a user