Repository: nushell/nushell
File: crates/nu-command/src/platform/input/input_.rs (Rust)

Code before:
                (Type::Nothing, Type::Any),
                (Type::List(Box::new(Type::String)), Type::Any)])
            .allow_variants_without_examples(true)
            .optional("prompt", SyntaxShape::String, "Prompt to show the user.")
            .named(
                "bytes-until-any",
                SyntaxShape::String,
                "read bytes (not text) until any of the given stop bytes is seen",
                Some('u'),
            )
            .named(
                "numchar",
                SyntaxShape::Int,
                "number of characters to read; suppresses output",
                Some('n'),
            )
            .named(
                "default",
                SyntaxShape::String,
                "default value if no input is provided",
                Some('d'),
            )
            .named(
                "history-file",
                SyntaxShape::Filepath,
                "path to a file to read and write command history. This is a text file, and will be created if it doesn't exist. Can specific to your input prompt.",
                None,
            )
            .named(
                "max-history",
                SyntaxShape::Int,
                "The maximum number of entries to keep in the history, defaults to $env.config.history.max_size",
                None,
            )
            .switch("suppress-output", "don't print keystroke values", Some('s'))
            .category(Category::Platform)
    }

    fn run(
        &self,
        engine_state: &EngineState,
        stack: &mut Stack,
        call: &Call,
        input: PipelineData,
    ) -> Result<PipelineData, ShellError> {
        // Those options are not supported by reedline, default to the legacy
        // implementation
        let use_legacy = [
            call.get_flag::<String>(engine_state, stack, "bytes-until-any")?
                .is_some(),
            call.has_flag(engine_state, stack, "suppress-output")?,

Review comment (suggestion):
I think this is confusing the way it's worded. I'm not sure if mine below is accurate or not.
```suggestion
                "Path to a file to read and write command history. This is a text file and will be created if it doesn't exist. Will be used as the selection list.",
```

Code after:
                (Type::Nothing, Type::Any),
                (Type::List(Box::new(Type::String)), Type::Any)])
            .allow_variants_without_examples(true)
            .optional("prompt", SyntaxShape::String, "Prompt to show the user.")
            .named(
                "bytes-until-any",
                SyntaxShape::String,
                "read bytes (not text) until any of the given stop bytes is seen",
                Some('u'),
            )
            .named(
                "numchar",
                SyntaxShape::Int,
                "number of characters to read; suppresses output",
                Some('n'),
            )
            .named(
                "default",
                SyntaxShape::String,
                "default value if no input is provided",
                Some('d'),
            )
            .switch(
                "reedline",
                "use the reedline library, defaults to false",
                None
            )
            .named(
                "history-file",
                SyntaxShape::Filepath,
                "Path to a file to read and write command history. This is a text file and will be created if it doesn't exist. Will be used as the selection list.",
                None,
            )
            .named(
                "max-history",
                SyntaxShape::Int,
                "The maximum number of entries to keep in the history, defaults to $env.config.history.max_size.",
                None,
            )
            .switch("suppress-output", "don't print keystroke values", Some('s'))
            .category(Category::Platform)
    }

    fn run(
        &self,
        engine_state: &EngineState,
        stack: &mut Stack,
        call: &Call,
        input: PipelineData,
    ) -> Result<PipelineData, ShellError> {
        // Check if we should use the legacy implementation or the reedline implementation