adds examples

This commit is contained in:
Florent Vilmart 2025-03-22 13:23:25 -04:00
parent 6fe5851176
commit f5719513d1

View File

@ -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,
},
]
}
}