forked from extern/nushell
make first
behave same way as last
: always return list when with number argument (#6616)
* make `first` behave same way as `last` * better behaviour * fix tests * add tests
This commit is contained in:
@ -146,7 +146,7 @@ fn first_helper(
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
if rows_desired == 1 {
|
||||
if rows_desired == 1 && rows.is_none() {
|
||||
match input_peek.next() {
|
||||
Some(val) => Ok(val.into_pipeline_data()),
|
||||
None => Err(ShellError::AccessBeyondEndOfStream(head)),
|
||||
|
Reference in New Issue
Block a user