use nu_engine::CallExt; use nu_protocol::ast::{Call, CellPath}; use nu_protocol::engine::{Command, EvaluationContext}; use nu_protocol::{Signature, SyntaxShape, Value}; pub struct Get; impl Command for Get { fn name(&self) -> &str { "get" } fn usage(&self) -> &str { "Extract data using a cell path." } fn signature(&self) -> nu_protocol::Signature { Signature::build("wrap").required( "cell_path", SyntaxShape::CellPath, "the cell path to the data", ) } fn run( &self, context: &EvaluationContext, call: &Call, input: Value, ) -> Result { let cell_path: CellPath = call.req(context, 0)?; input.follow_cell_path(&cell_path.members) } }