|
@@ -4,8 +4,10 @@ use std::{
|
|
|
marker::PhantomData,
|
|
marker::PhantomData,
|
|
|
path::{Path, PathBuf},
|
|
path::{Path, PathBuf},
|
|
|
str,
|
|
str,
|
|
|
|
|
+ time::Duration,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+use indicatif::{ProgressBar, ProgressStyle};
|
|
|
use serde::{de::DeserializeOwned, Serialize};
|
|
use serde::{de::DeserializeOwned, Serialize};
|
|
|
use simplelog::ConfigBuilder;
|
|
use simplelog::ConfigBuilder;
|
|
|
|
|
|
|
@@ -196,3 +198,13 @@ macro_rules! async_daemonize {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+pub fn progress_bar(message: &str) -> ProgressBar {
|
|
|
|
|
+ let progress_bar = ProgressBar::new(42);
|
|
|
|
|
+ progress_bar.set_style(
|
|
|
|
|
+ ProgressStyle::default_spinner().template("{spinner:.green} {wide_msg}").unwrap(),
|
|
|
|
|
+ );
|
|
|
|
|
+ progress_bar.enable_steady_tick(Duration::from_millis(100));
|
|
|
|
|
+ progress_bar.set_message(message.to_string());
|
|
|
|
|
+ progress_bar
|
|
|
|
|
+}
|