[][src]Function term_basics_linux::prompt_custom

pub fn prompt_custom(
    msg: &str,
    his: &mut InputHistory,
    pc: PromptChar
) -> String

Prints a message to the user. The user can type its input next to the message on the same line. It will return the user input after the user pressed enter. It uses term_basics_linux::input_field_custom and supports the same operations. So you can provide your own InputHistory and PromptChar.

Example

use term_basics_linux as tbl;
let mut his = tbl::InputHistory::new(2);
his.add(&"hidden option 0".to_string());
his.add(&"hidden option 1".to_string());//provide options but the user can't see them.
let x = tbl::prompt_custom("enter input:", &mut his, tbl::PromptChar::None);
tbl::println(x);