mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 22:07:57 +02:00
WIP
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Example, IntoPipelineData, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
@ -92,23 +92,21 @@ fn into_binary(
|
||||
let head = call.head;
|
||||
// let column_paths: Vec<CellPath> = call.rest(context, 0)?;
|
||||
|
||||
Ok(input
|
||||
.map(move |v| {
|
||||
action(v, head)
|
||||
// FIXME: Add back in cell_path support
|
||||
// if column_paths.is_empty() {
|
||||
// action(v, head)
|
||||
// } else {
|
||||
// let mut ret = v;
|
||||
// for path in &column_paths {
|
||||
// ret =
|
||||
// ret.swap_data_by_cell_path(path, Box::new(move |old| action(old, old.tag())))?;
|
||||
// }
|
||||
input.map(move |v| {
|
||||
action(v, head)
|
||||
// FIXME: Add back in cell_path support
|
||||
// if column_paths.is_empty() {
|
||||
// action(v, head)
|
||||
// } else {
|
||||
// let mut ret = v;
|
||||
// for path in &column_paths {
|
||||
// ret =
|
||||
// ret.swap_data_by_cell_path(path, Box::new(move |old| action(old, old.tag())))?;
|
||||
// }
|
||||
|
||||
// Ok(ret)
|
||||
// }
|
||||
})
|
||||
.into_pipeline_data())
|
||||
// Ok(ret)
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
fn int_to_endian(n: i64) -> Vec<u8> {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Example, IntoPipelineData, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
@ -120,26 +120,24 @@ fn into_filesize(
|
||||
let head = call.head;
|
||||
// let call_paths: Vec<ColumnPath> = args.rest(0)?;
|
||||
|
||||
Ok(input
|
||||
.map(move |v| {
|
||||
action(v, head)
|
||||
input.map(move |v| {
|
||||
action(v, head)
|
||||
|
||||
// FIXME: Add back cell_path support
|
||||
// if column_paths.is_empty() {
|
||||
// action(&v, v.tag())
|
||||
// } else {
|
||||
// let mut ret = v;
|
||||
// for path in &column_paths {
|
||||
// ret = ret.swap_data_by_column_path(
|
||||
// path,
|
||||
// Box::new(move |old| action(old, old.tag())),
|
||||
// )?;
|
||||
// }
|
||||
// FIXME: Add back cell_path support
|
||||
// if column_paths.is_empty() {
|
||||
// action(&v, v.tag())
|
||||
// } else {
|
||||
// let mut ret = v;
|
||||
// for path in &column_paths {
|
||||
// ret = ret.swap_data_by_column_path(
|
||||
// path,
|
||||
// Box::new(move |old| action(old, old.tag())),
|
||||
// )?;
|
||||
// }
|
||||
|
||||
// Ok(ret)
|
||||
// }
|
||||
})
|
||||
.into_pipeline_data())
|
||||
// Ok(ret)
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
pub fn action(input: Value, span: Span) -> Value {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use nu_protocol::{
|
||||
ast::Call,
|
||||
engine::{Command, EngineState, Stack},
|
||||
Example, IntoPipelineData, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
Example, PipelineData, ShellError, Signature, Span, SyntaxShape, Value,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
@ -96,23 +96,21 @@ fn into_int(
|
||||
let head = call.head;
|
||||
// let column_paths: Vec<CellPath> = call.rest(context, 0)?;
|
||||
|
||||
Ok(input
|
||||
.map(move |v| {
|
||||
action(v, head)
|
||||
// FIXME: Add back cell_path support
|
||||
// if column_paths.is_empty() {
|
||||
// action(&v, v.tag())
|
||||
// } else {
|
||||
// let mut ret = v;
|
||||
// for path in &column_paths {
|
||||
// ret = ret
|
||||
// .swap_data_by_column_path(path, Box::new(move |old| action(old, old.tag())))?;
|
||||
// }
|
||||
input.map(move |v| {
|
||||
action(v, head)
|
||||
// FIXME: Add back cell_path support
|
||||
// if column_paths.is_empty() {
|
||||
// action(&v, v.tag())
|
||||
// } else {
|
||||
// let mut ret = v;
|
||||
// for path in &column_paths {
|
||||
// ret = ret
|
||||
// .swap_data_by_column_path(path, Box::new(move |old| action(old, old.tag())))?;
|
||||
// }
|
||||
|
||||
// Ok(ret)
|
||||
// }
|
||||
})
|
||||
.into_pipeline_data())
|
||||
// Ok(ret)
|
||||
// }
|
||||
})
|
||||
}
|
||||
|
||||
pub fn action(input: Value, span: Span) -> Value {
|
||||
|
Reference in New Issue
Block a user