mod-cli 0.6.4

A fully customizable, feature-rich CLI framework for Rust. Define commands, prefixes, styled output, and more—built for flexibility and speed.
Documentation
use crate::output::hook;
use rpassword::read_password;
use std::io::{self, Write};

/// Prompts for a secure password (no echo)
pub fn prompt_password(prompt: &str) -> String {
    print!("{prompt}: ");
    if let Err(e) = io::stdout().flush() {
        hook::warn(&format!("flush failed: {e}"));
    }

    match read_password() {
        Ok(password) => password,
        Err(e) => {
            hook::error(&format!("failed to read password: {e}"));
            String::new()
        }
    }
}