Skip to content

Commit 007d15e

Browse files
Add multiline example for input command (#16329)
# Description Adds an example that documents how to use `input --reedline` to collect multiple lines of input from the user I also removed an extraneous and inconsistent space in the following example. # User-Facing Changes Documentation addition # Tests + Formatting I did not run any tests or autoformatters because of the docs-only nature of the change, and the fact that I copy-pasted the format from an existing example. If the autoformatter is unhappy, I apologize. # After Submitting This PR should automatically update the docs site at the next release, so no need to do anything there. --------- Co-authored-by: Stefan Holderbach <[email protected]>
1 parent 3e37922 commit 007d15e

File tree

1 file changed

+6
-1
lines changed
  • crates/nu-command/src/platform/input

1 file changed

+6
-1
lines changed

crates/nu-command/src/platform/input/input_.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,14 @@ impl Command for Input {
218218
example: "let user_input = (input --default 10)",
219219
result: None,
220220
},
221+
Example {
222+
description: "Get multiple lines of input from the user (newlines can be entered using `Alt` + `Enter` or `Ctrl` + `Enter`), and assign to a variable",
223+
example: "let multiline_input = (input --reedline)",
224+
result: None,
225+
},
221226
Example {
222227
description: "Get input from the user with history, and assign to a variable",
223-
example: "let user_input = ([past,command,entries] | input )",
228+
example: "let user_input = ([past,command,entries] | input --reedline)",
224229
result: None,
225230
},
226231
Example {

0 commit comments

Comments
 (0)