NAME

App::UnANSI - Remove ANSI coloring from output or files

VERSION

version 0.003

SYNOPSIS

use App::UnANSI;
my $unansi = App::UnANSI->new();
my $some_line = get_line_with_coloring();
$unansi->remove_ansi_colors($some_line);
# $some_line is now clean

DESCRIPTION

This is the underlying implementation of unansi.

This is the documentation of the command implementation. You are most likely looking for the command documentation itself: unansi.

ATTRIBUTES

files

Can be set on instantiation, returns a list of files to process.

my @files_to_process = $unansi->files;

METHODS

new

Creates a new instance. You can provide files to process.

my $unansi = App::UnANSI->new();

# or

my $unansi = App::UnANSI->new(
    'files' => [ 'foo.txt', 'bar.txt' ],
);

new_with_options

Creates a new instance using options from the command line. This is what the CLI uses.

run

Processes either the files or the input from the command line. In both cases it prints to the screen. This might change for files in the future.

remove_ansi_colors

The actual code that removes the ANSI coloring from a string. It alters the string it receives, for speed purposes.

my $line = '...';
$unansi->remove_ansi_colors($line);

AUTHOR

Sawyer X

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Sawyer X.

This is free software, licensed under:

The MIT (X11) License