From 4205edbc70176d7bbd66a4eea0ed7704a67d1782 Mon Sep 17 00:00:00 2001 From: Sophia June Turner <547158+sophiajt@users.noreply.github.com> Date: Fri, 17 Nov 2023 06:53:51 +1300 Subject: [PATCH] Fix the output type for 'view files' (#11077) # Description # User-Facing Changes # Tests + Formatting # After Submitting Co-authored-by: JT <547158+jntrnr@users.noreply.github.com> --- crates/nu-command/src/debug/view_files.rs | 27 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/crates/nu-command/src/debug/view_files.rs b/crates/nu-command/src/debug/view_files.rs index ff38103ad..ad1c5c5ed 100644 --- a/crates/nu-command/src/debug/view_files.rs +++ b/crates/nu-command/src/debug/view_files.rs @@ -22,7 +22,15 @@ impl Command for ViewFiles { fn signature(&self) -> nu_protocol::Signature { Signature::build("view files") - .input_output_types(vec![(Type::Nothing, Type::String)]) + .input_output_types(vec![( + Type::Nothing, + Type::Table(vec![ + ("filename".into(), Type::String), + ("start".into(), Type::Int), + ("end".into(), Type::Int), + ("size".into(), Type::Int), + ]), + )]) .category(Category::Debug) } @@ -51,10 +59,17 @@ impl Command for ViewFiles { } fn examples(&self) -> Vec { - vec![Example { - description: "View the files registered in nushell's EngineState memory", - example: r#"view files"#, - result: None, - }] + vec![ + Example { + description: "View the files registered in Nushell's EngineState memory", + example: r#"view files"#, + result: None, + }, + Example { + description: "View how Nushell was originally invoked", + example: r#"view files | get 0"#, + result: None, + }, + ] } }