The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Progress::Any::Output::TermProgressBarColor - Output progress to terminal as color bar

VERSION

This document describes version 0.22 of Progress::Any::Output::TermProgressBarColor (from Perl distribution Progress-Any-Output-TermProgressBarColor), released on 2016-03-11.

SYNOPSIS

 use Progress::Any::Output;

 # use default options
 Progress::Any::Output->set('TermProgressBarColor');

 # set options
 Progress::Any::Output->set('TermProgressBarColor',
                            width=>50, fh=>\*STDERR, show_delay=>5);

DESCRIPTION

THIS IS AN EARLY RELEASE, SOME THINGS ARE NOT YET IMPLEMENTED E.G. TEMPLATE, STYLES, COLOR THEMES.

Sample screenshots:

This output displays progress indicators as colored progress bar on terminal. It produces output similar to that produced by Term::ProgressBar, except that it uses the Progress::Any framework and has additional features:

  • colors and color themes

  • template and styles

  • displaying message text in addition to bar/percentage number

  • wide character support

XXX option to cleanup when complete or not (like in Term::ProgressBar) and should default to 1.

METHODS

new(%args) => OBJ

Instantiate. Usually called through Progress::Any::Output->set("TermProgressBarColor", %args).

Known arguments:

  • wide => bool

    If set to 1, enable wide character support (requires Text::ANSI::WideUtil.

  • width => INT

    Width of progress bar. The default is to detect terminal width and use the whole width.

  • color_theme => STR

    Not yet implemented.

    Choose color theme. To see what color themes are available, use list_color_themes().

  • style => STR

    Not yet implemented.

    Choose style. To see what styles are available, use list_styles(). Styles determine the characters used for drawing the bar, alignment, etc.

  • template => STR (default: '%p [%B]%e')

    Not yet implemented.

    See fill_template in Progress::Any's documentation. Aside from template strings supported by Progress::Any, this output recognizes these additional strings: %b to display the progress bar (using the rest of the available width), %B to display the progress bar as well as the message inside it.

  • fh => handle (default: \*STDOUT)

    Instead of the default STDOUT, you can direct the output to another filehandle.

  • show_delay => int

    If set, will delay showing the progress bar until the specified number of seconds. This can be used to create, e.g. a CLI application that is relatively not chatty but will display progress after several seconds of seeming inactivity to indicate users that the process is still going on.

keep_delay_showing()

Can be called to reset the timer that counts down to show progress bar when show_delay is defined. For example, if show_delay is 5 seconds and two seconds have passed, it should've been 3 seconds before progress bar is shown in the next update(). However, if you call this method, it will be 5 seconds again before showing.

ENVIRONMENT

COLOR => BOOL

Can be used to force or disable color.

COLOR_DEPTH => INT

Can be used to override color depth detection. See Color::ANSI::Util.

COLUMNS => INT

Can be used to override terminal width detection.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Progress-Any-Output-TermProgressBarColor.

SOURCE

Source repository is at https://github.com/perlancar/perl-Progress-Any-Output-TermProgressBarColor.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Progress-Any-Output-TermProgressBarColor

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

Progress::Any

Term::ProgressBar

Ruby library: ruby-progressbar, https://github.com/jfelchner/ruby-progressbar

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.