use nanospinner::{MultiSpinner, Spinner};
use std::thread;
use std::time::Duration;
fn main() {
let handle = Spinner::new("Installing dependencies...").start();
thread::sleep(Duration::from_secs(2));
handle.update("Almost there...");
thread::sleep(Duration::from_secs(1));
handle.success_with("Installed 47 packages.");
thread::sleep(Duration::from_millis(500));
let handle = MultiSpinner::new().start();
let build = handle.add("Building project...");
let lint = handle.add("Running linter...");
let test = handle.add("Running tests...");
let docs = handle.add("Generating docs...");
let deps = handle.add("Checking dependencies...");
thread::sleep(Duration::from_secs(2));
lint.clear(); thread::sleep(Duration::from_secs(1));
build.success();
docs.fail_with("Missing doc comments.");
deps.warn_with("2 outdated packages.");
thread::sleep(Duration::from_secs(2));
test.info_with("42 tests passed (cached).");
handle.stop();
}