1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-27 15:40:03 +08:00

feat: fix util_term

This commit is contained in:
2023-10-25 01:15:28 +08:00
parent 16e859c785
commit c56b7deaaf

View File

@@ -1,16 +1,17 @@
use std::io::{self, Write};
use crate::print_ex;
pub const RED: &str = "\x1B[91m";
pub const GREEN: &str = "\x1B[92m";
use crate::util_msg;
pub const RED: &str = "\x1B[91m";
pub const GREEN: &str = "\x1B[92m";
pub const YELLOW: &str = "\x1B[93m";
pub const BOLD: &str = "\x1B[1m";
pub const UNDER: &str = "\x1B[4m";
pub const END: &str = "\x1B[0m";
pub const BOLD: &str = "\x1B[1m";
pub const UNDER: &str = "\x1B[4m";
pub const END: &str = "\x1B[0m";
pub fn read_yes_no(hint: &str) -> bool {
loop {
print_ex!("{} (Yes/No): ", hint);
util_msg::print_ex(&format!("{} (Yes/No): ", hint), false);
io::stdout().flush().ok();
let mut buff = String::new();
let _ = io::stdin().read_line(&mut buff).expect("Read line from stdin");