This commit is contained in:
Yura Shatunov 2022-08-18 22:53:46 +07:00 committed by GitHub
parent 1843fdc060
commit 2b955f82b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)]