diff --git a/vlib/readline/README.md b/vlib/readline/README.md index a96936cd81..24a2b527d8 100644 --- a/vlib/readline/README.md +++ b/vlib/readline/README.md @@ -6,15 +6,21 @@ from a terminal in an easy and structured manner. The module provides an easy way to prompt the user for questions or even make a REPL or an embedded console. -Use `readline.Readline` if you want to include more -advanced features such as history or simply use -`readline.read_line('Please confirm (y/n):')` directly -for one-off user interactions. -# Usage +# Usage: -```v ignore -import readline { Readline } +```v +import readline -Readline.read_line('Continue?: (y/n)') +mut r := readline.Readline{} +answer := r.read_line('hello: ') ? +println(answer) +``` + +or just: +```v +import readline { read_line } + +input := read_line('What is your name: ') ? +println('Your name is: $input') ```