console-rs / dialoguer

Rust utility library for nice command line prompts and similar things
MIT License
1.31k stars 143 forks source link

default and allow_empty #316

Open Masber opened 1 month ago

Masber commented 1 month ago

Dear dialoguer community,

I have an example like this

Input::new()
        .with_prompt("Type socks5 proxy URL")
        .default("socks5h://127.0.0.1:1080".to_string())
        .allow_empty(true)
        .interact_text()
        .unwrap();

Would it be possible to allow the user to enter an empty value using default and allow_empty functions combined?

thank you