Add non-functioning headers command

This commit is contained in:
Sam Hedin 2020-03-27 21:02:48 +01:00
parent 26602e437e
commit c05511f6c1
3 changed files with 6 additions and 1 deletions

View File

@ -276,6 +276,7 @@ pub fn create_default_context(
whole_stream_command(Autoview),
whole_stream_command(Table),
// Text manipulation
whole_stream_command(Headers),
whole_stream_command(SplitColumn),
whole_stream_command(SplitRow),
whole_stream_command(Lines),

View File

@ -25,6 +25,7 @@ pub(crate) mod edit;
pub(crate) mod enter;
#[allow(unused)]
pub(crate) mod evaluate_by;
pub(crate) mod headers;
pub(crate) mod exit;
pub(crate) mod first;
pub(crate) mod format;
@ -216,3 +217,4 @@ pub(crate) use what::What;
pub(crate) use where_::Where;
pub(crate) use which_::Which;
pub(crate) use wrap::Wrap;
pub(crate) use headers::Headers;

View File

@ -6,6 +6,8 @@ use nu_errors::ShellError;
use nu_protocol::{ReturnSuccess, Signature, UntaggedValue, Value};
pub struct Headers;
#[derive(Deserialize)]
pub struct HeadersArgs {}
impl WholeStreamCommand for Headers {
fn name(&self) -> &str {
@ -26,7 +28,7 @@ impl WholeStreamCommand for Headers {
}
}
pub fn count(
CountArgs {}: CountArgs,
HeadersArgs {}: HeadersArgs,
RunnableContext { input, name, .. }: RunnableContext,
) -> Result<OutputStream, ShellError> {
let stream = async_stream! {