diff --git a/vlib/os/os.v b/vlib/os/os.v index a96d79908a..b3fc5ff46c 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -662,6 +662,13 @@ pub fn file_name(path string) string { return path.all_after(path_separator) } +// input returns a one-line string from stdin, after printing a prompt +pub fn input(prompt string) string { + print(prompt) + flush() + return get_line() +} + // get_line returns a one-line string from stdin pub fn get_line() string { str := get_raw_line()