update readme

master
Avril 4 years ago
parent e81bf8403f
commit 22b77fdd89
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -2,7 +2,7 @@
name = "termprogress" name = "termprogress"
description = "A terminal progress bar renderer with status and spinners" description = "A terminal progress bar renderer with status and spinners"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
version = "0.2.3" version = "0.b2.4"
authors = ["Avril <flanchan@cumallover.me>"] authors = ["Avril <flanchan@cumallover.me>"]
edition = "2018" edition = "2018"

@ -74,7 +74,9 @@ Without this, `Bar` will not attempt to get the terminal's size to prevent overf
## Traits ## Traits
The library comes with traits for progress bars: [`ProgressBar`][progress-bar], and [`Spinner`][spinner]. The library comes with traits for progress bars: [`ProgressBar`][progress-bar], and [`Spinner`][spinner].
The default implementations for these are `Bar` and `Spin`, but you can provide your own implementations too for more customisability The default implementations for these are `Bar` and `Spin`, but you can provide your own implementations too for more customisability.
There is also `Silent`, which implements both `ProgressBar` and `Spinner`, and does nothing, to allow for easily turning off or on progress displays depending on config.
[progress-bar]: ./src/inter.rs [progress-bar]: ./src/inter.rs
[spinner]: ./src/inter.rs [spinner]: ./src/inter.rs
@ -90,8 +92,14 @@ pub fn does_work<P: ProgressBar>(bar: &mut P)
does_work(&mut Bar::default()); does_work(&mut Bar::default());
does_work(&mut MyBar::new()); does_work(&mut MyBar::new());
if NOPROGRESS {
does_wotk(&mut Silent)
} else {
does_work(&mut Bar::default())
}
``` ```
## License # License
GPL'd with love <3 GPL'd with love <3

@ -44,7 +44,7 @@ pub trait Spinner: Display
} }
/// A trait for creating a progress bar or spinner with a title. /// A trait for creating a progress bar or spinner with a title.
pub trait WithTitle: Sized + ProgressBar + Display pub trait WithTitle: Sized + Display
{ {
fn with_title(len: usize, string: impl AsRef<str>) -> Self; fn with_title(len: usize, string: impl AsRef<str>) -> Self;
fn update(&mut self); fn update(&mut self);

Loading…
Cancel
Save