rusty_cli/inputs/
text_input.rs

1use dialoguer::Input;
2
3pub struct TextInput {}
4
5impl TextInput {
6
7    /// Gets the value of the text input
8    pub fn get_value(prompt: Option<String>) -> String {
9        let mut input = Input::<String>::new();
10        if prompt.is_some() {
11            input.with_prompt(prompt.unwrap());
12        }
13        input.interact().unwrap()
14    }
15}