From d5c357e4564318577cf7e36d0f29b566f61dc825 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sat, 19 Sep 2020 15:04:18 +0200 Subject: 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. --- src/output.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/output.rs') 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, } -- cgit v1.2.1