Skip to content

Commit 39e777b

Browse files
DilumAluthgeLilithHafner
authored andcommitted
[docs] Add an example to the Base.prompt docstring (JuliaLang#43638)
1 parent 0cb31a5 commit 39e777b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

base/util.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,16 @@ is encountered or EOF (^D) character is entered on a blank line. If a `default`
293293
then the user can enter just a newline character to select the `default`.
294294
295295
See also `Base.getpass` and `Base.winprompt` for secure entry of passwords.
296+
297+
# Example
298+
299+
```julia-repl
300+
julia> your_name = Base.prompt("Enter your name");
301+
Enter your name: Logan
302+
303+
julia> your_name
304+
"Logan"
305+
```
296306
"""
297307
function prompt(input::IO, output::IO, message::AbstractString; default::AbstractString="")
298308
msg = !isempty(default) ? "$message [$default]: " : "$message: "

0 commit comments

Comments
 (0)