From f5719513d1a76e85488098fe03d38808351224ae Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Sat, 22 Mar 2025 13:23:25 -0400 Subject: [PATCH] adds examples --- crates/nu-command/src/platform/input/input_.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/nu-command/src/platform/input/input_.rs b/crates/nu-command/src/platform/input/input_.rs index 74697527da..963565c0dd 100644 --- a/crates/nu-command/src/platform/input/input_.rs +++ b/crates/nu-command/src/platform/input/input_.rs @@ -134,6 +134,7 @@ impl Command for Input { left_prompt: prompt_str.unwrap_or("".to_string()), right_prompt: "".to_string(), }; + let mut line_editor = Reedline::create(); line_editor = line_editor.with_ansi_colors(false); line_editor = match history { @@ -184,6 +185,16 @@ impl Command for Input { example: "let user_input = (input --default 10)", result: None, }, + Example { + description: "Get input from the user with history, and assign to a variable", + example: "let user_input = (input --history [past,command,entries])", + result: None, + }, + Example { + description: "Get input from the user with history backed by a file, and assign to a variable", + example: "let user_input = (input --history ./history.txt)", + result: None, + }, ] } }