haj 0.2.0

fast, quiet, beautiful package managemer and tui for Arch Linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use indicatif::{ProgressBar, ProgressStyle};
use std::time::Duration;

pub fn spinner(message: &str) -> ProgressBar {
    let pb = ProgressBar::new_spinner();
    pb.enable_steady_tick(Duration::from_millis(80));

    pb.set_style(
        ProgressStyle::with_template("{spinner:.cyan} {msg}")
            .unwrap()
            .tick_chars("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏✓"),
    );

    pb.set_message(message.to_string());
    pb
}