Textualize / rich

Rich is a Python library for rich text and beautiful formatting in the terminal.
https://rich.readthedocs.io/en/latest/
MIT License
49.65k stars 1.73k forks source link

REQUEST-3552: Added a choices separator to Prompt.ask. This argument … #3553

Open vivekkeshore opened 2 weeks ago

vivekkeshore commented 2 weeks ago

Type of changes

Checklist

Description

Issue - https://github.com/Textualize/rich/issues/3552

Added a choices separator to Prompt.ask. This argument will allow the choices to be separated by anything other than the default "/" in the console.

Example

from rich.prompt import Prompt

predicate = Prompt.ask(
    f"[green]Enter the animal name[/green]",
    choices=["Lion", "Tiger", "Bear", "Giraffe", "Elephant"],
    case_sensitive=False,
    show_choices=True,
        choices_separator=" | " 
)

Enter the animal name [Lion | Tiger | Bear | Giraffe | Elephant]: