aboutsummaryrefslogtreecommitdiff
path: root/src/output.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-09-19 15:04:18 +0200
committerDaniel Mueller <deso@posteo.net>2020-09-20 10:50:26 -0700
commitd5c357e4564318577cf7e36d0f29b566f61dc825 (patch)
tree3d2d95abef64a342e757509bab29e7482398f370 /src/output.rs
parent57a177e2f946390559a1f17787c5a15d23ac3393 (diff)
downloadnitrocli-d5c357e4564318577cf7e36d0f29b566f61dc825.tar.gz
nitrocli-d5c357e4564318577cf7e36d0f29b566f61dc825.tar.bz2
Add the --progress option to the fill command
The fill command starts a background operation on a Nitrokey Storage device that fills the SD card with random data. This patch adds a new option, --progress, to the fill command that checks if a fill operation is already running on the device and shows its progress.
Diffstat (limited to 'src/output.rs')
-rw-r--r--src/output.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/output.rs b/src/output.rs
index bd6c03c..1811cc3 100644
--- a/src/output.rs
+++ b/src/output.rs
@@ -26,10 +26,10 @@ pub struct ProgressBar {
impl ProgressBar {
/// Creates a new empty progress bar.
- pub fn new() -> ProgressBar {
+ pub fn new(progress: u8) -> ProgressBar {
ProgressBar {
redraw: true,
- progress: 0,
+ progress,
toggle: false,
finished: false,
}