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

NAME

Progress::Any::Output::TermMessage - Output progress to terminal as simple message

VERSION

This document describes version 0.041 of Progress::Any::Output::TermMessage (from Perl distribution Progress-Any-Output-TermMessage), released on 2018-03-26.

SYNOPSIS

 use Progress::Any::Output;
 Progress::Any::Output->set('TermMessage', template=>"[%n] (%P/%T) %m");

DESCRIPTION

This output displays progress indicators as messages on terminal.

METHODS

new(%args) => OBJ

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

Known arguments:

  • fh => GLOB (default: \*STDERR)

    Wheere to send progress message.

  • template => STR (default: '(%P/%T) %m')

    Will be used to do $progress->fill_template(). See Progress::Any for supported template strings.

  • single_line_task => BOOL (default: 0)

    If set to true, will reuse line using a series of \b to get back to the original position, as long as the previous update is for the same task and the finished attribute is false. For example:

     use Progress::Any;
     use Progress::Any::Output;
    
     Progress::Any::Output->set("TermMessage",
         single_line_task=>0, template=>"%t %m");
     my $progress = Progress::Any->get_indicator(
         task => 'copy', title => 'Copying file ... ');
     $progress->update(message=>'file1.txt');
     $progress->update(message=>'file2.txt');
     $progress->update(message=>'file3.txt');
     $progress->finish(message=>'success');

    will result in:

     Copying file ... file1.txt_
     Copying file ... file2.txt_
     Copying file ... file3.txt_
     Copying file ... success
     _

    all in one line.

ENVIRONMENT

PROGRESS_TERM_MESSAGE

Bool. Forces disabling or enabling progress output (just for this output).

In the absence of PROGRESS_TERM_MESSAGE and PROGRESS, will default to 1 if filehandle is tested to be in interactive mode (using -t).

PROGRESS

Bool. Forces disabling or enabling progress output (for all outputs).

HOMEPAGE

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

SOURCE

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

BUGS

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

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

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

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