Image::Synchronize::ProgressBar - A simple progress bar that also works in closures.
This class implements a simple progress bar based on Term::ProgressBar, somewhat similar to Term::ProgressBar::Simple. The latter doesn't work well in closures; the current implementation does.
$pb = Image::Synchronize::ProgressBar->new(%options);
Creates a new instance of the progress bar. Accepts the following options (mostly similar to Term::ProgressBar):
The target count for the progress bar. When the progress count reaches this value, then the task is assumed to be complete.
The filehandle to output to. Defaults to STDERR.
The name of the progress bar. This name is printed at the left-hand side of the progress bar.
Should the progress bar be displayed? If set to a true value, then the progress bar is always displayed. If set to a false value, then the progress bar is not displayed, but the message method still prints to standard output (unlike for the silent option). If not set, then the progress bar is displayed only if the program detects that it is running interactively.
silent
This option is not inherited from Term::ProgressBar.
Term::ProgressBar
If set to a true value, then the progress bar does nothing. In particular, it does not print anything when you call the message method on it. Is ignored if show_bar is defined. For an alternative, see show_bar.
show_bar
The width of the terminal. Use if the automatic detection fails.
The progress bar is removed when the task is complete, and displays an estimate of how long it will take for the task to complete.
$pb->add($amount); $pb->add; # adds 1
Add the indicated $amount, or 1, toward the target of the progress bar.
$amount
$pb->done;
Declare the task to be complete.
$pb->message(@message);
Prints a message (like print), taking into account the progress bar.
This module uses the following non-core Perl modules:
IO::Interactive
Louis Strous <LS@quae.nl>
Copyright (c) 2016-2018 Louis Strous.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Image::Synchronize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Image::Synchronize
CPAN shell
perl -MCPAN -e shell install Image::Synchronize
For more information on module installation, please visit the detailed CPAN module installation guide.