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>2021-01-10 21:05:44 -0800
commit3152a6d3c1e46243a69fe8ef8066027ca4d38d47 (patch)
tree05e31b4b8ffdf990911ef5392b23ec2aca945e52 /src/output.rs
parente085dcda752f7a5007e35c2baecbf094d888faa0 (diff)
downloadnitrocli-3152a6d3c1e46243a69fe8ef8066027ca4d38d47.tar.gz
nitrocli-3152a6d3c1e46243a69fe8ef8066027ca4d38d47.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,
}