mirror of
https://github.com/nushell/nushell
synced 2024-12-28 14:03:09 +00:00
parent
1843fdc060
commit
2b955f82b7
1 changed files with 9 additions and 4 deletions
|
@ -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 a new issue