flexprice-cli 0.1.1

A beautiful terminal CLI for the FlexPrice billing platform
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use indicatif::{ProgressBar, ProgressStyle};
use std::time::Duration;

/// Create a styled spinner for loading operations
pub fn create_spinner(msg: &str) -> ProgressBar {
    let spinner = ProgressBar::new_spinner();
    spinner.set_style(
        ProgressStyle::with_template("  {spinner:.cyan} {msg}")
            .unwrap()
            .tick_strings(&["", "", "", "", "", "", "", "", "", "", ""]),
    );
    spinner.set_message(msg.to_string());
    spinner.enable_steady_tick(Duration::from_millis(80));
    spinner
}