App-Greple-charcode

 view release on metacpan or  search on metacpan

lib/App/Greple/annotate.pm  view on Meta::CPAN

package App::Greple::annotate;

use 5.024;
use warnings;
use utf8;

our $VERSION = "0.9909";

=encoding utf-8

=head1 NAME

App::Greple::annotate - greple module for generic annotation

=head1 SYNOPSIS

B<greple> B<-Mannotate> [ I<module option> ] -- [ I<command option> ] ...

=head1 VERSION

Version 0.9909

=head1 DESCRIPTION

C<App::Greple::annotate> module is made for C<App::Greple::charcode>
to display annotation for each matched text in the following style.

    $ greple -Mcharcode '\P{ASCII}' charcode.pm

            ┌───  12 \x{fe0e} \N{VARIATION SELECTOR-15}
            │ ┌─  14 \x{a9} \N{COPYRIGHT SIGN}
            │ ├─  14 \x{fe0e} \N{VARIATION SELECTOR-15}
    Copyright︎ ©︎ 2025 Kazumasa Utashiro.

=for html <p>
<img width="750" src="https://raw.githubusercontent.com/kaz-utashiro/greple-charcode/refs/heads/main/images/ka-ko.png">
</p>

=head1 COMMAND OPTIONS

=over 7

=item B<--annotate>, B<--no-annotate>

Print annotation or not.  Enabled by default, so use C<--no-annotate>
to disable it.

=item B<--annotate::config>=I<params>

Set configuration paarameters.

=item B<-->[B<no->]B<align>

Align annotation or not.
Default true.

=item B<--align-all>

Align to the same column for all lines

=item B<--align-side>

Align to the longest line length, regardless of match position.

=item B<--alignto>=I<column>

Align to I<column> position.

=back

=head1 MODULE OPTIONS and PARAMS

=over 7

=item B<--config>=I<params>

Set configuration parameters.

=item B<--alignto>=I<column>

=item B<config>(B<alignto>=I<column>)

Align annotation messages.  Defaults to C<1>, which aligns to the
rightmost column; C<0> means no align; if a value of C<2> or greater
is given, it aligns to that numbered column.

I<column> can be negative; if C<-1> is specified, align to the same
column for all lines.  If C<-2> is specified, align to the longest
line length, regardless of match position.

=item B<--split>[=I<#>]

=item config(B<split>=[I<#>])

Defaults to C<0>.  Use C<--split> or C<--split=1> to enable it.  If a
pattern matching multiple characters is given, annotate each character



( run in 0.887 second using v1.01-cache-2.11-cpan-df04353d9ac )