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 <sholderbach@users.noreply.github.com>
This commit is contained in:
Harper Andrews
2025-08-02 14:04:20 -05:00
committed by GitHub
parent 3e37922537
commit 007d15ed9f

View File

@ -218,9 +218,14 @@ impl Command for Input {
example: "let user_input = (input --default 10)",
result: None,
},
Example {
description: "Get multiple lines of input from the user (newlines can be entered using `Alt` + `Enter` or `Ctrl` + `Enter`), and assign to a variable",
example: "let multiline_input = (input --reedline)",
result: None,
},
Example {
description: "Get input from the user with history, and assign to a variable",
example: "let user_input = ([past,command,entries] | input )",
example: "let user_input = ([past,command,entries] | input --reedline)",
result: None,
},
Example {