NAME

Progress::Any::Output::TermSpin - Output progress to terminal as spinning cursor

VERSION

This document describes version 0.02 of Progress::Any::Output::TermSpin (from Perl distribution Progress-Any-Output-TermSpin), released on 2015-01-29.

SYNOPSIS

use Progress::Any::Output;

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

# set options
Progress::Any::Output->set('TermSpin',
                           style=>"bubble", fh=>\*STDOUT, speed=>0.2, show_delay=>5);

DESCRIPTION

METHODS

new(%args) => obj

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

Known arguments:

  • style => str (default: 'line')

    Available styles:

    • bubble

      .oOo.

    • line

      |/-\.

      "\x{25cb}" does not map to ascii at (eval 1660) line 1. "\x{25d4}" does not map to ascii at (eval 1660) line 1. "\x{25d1}" does not map to ascii at (eval 1660) line 1. "\x{25d5}" does not map to ascii at (eval 1660) line 1. "\x{25cf}" does not map to ascii at (eval 1660) line 1. =item * pie_utf8

      \x{25cb}\x{25d4}\x{25d1}\x{25d5}\x{25cf}.

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

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

  • speed => float (default: 0.2)

  • show_delay => int

    If set, will delay showing the spinning cursor 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.

keep_delay_showing()

Can be called to reset the timer that counts down to show spinning cursor 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 spinning cursor is shown in the next update(). However, if you call this method, it will be 5 seconds again before showing.

ENVIRONMENT

SEE ALSO

Progress::Any

HOMEPAGE

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

SOURCE

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

BUGS

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

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.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 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.