NAME

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

SYNOPSIS

greple -Mannotate ...

VERSION

Version 0.9902

DESCRIPTION

App::Greple::annotate module is made for 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.

COMMAND OPTIONS

--annotate, --no-annotate

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

MODULE OPTIONS

--align=column

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

--split, $--no-split

If a pattern matching multiple characters is given, annotate each character independently.

VARIABLES

$App::Greple::annotate::ANNOTATE

Hold function reference to produce annotation text. Default function is declared as this:

our $ANNOTATE //= sub {
    my %param = @_;
    my($column, $str) = @param{qw(column match)};
    sprintf("%3d %s", $column, $str);
};

Parameter is passed by column and match labeled list.

CONFIGURATION

Configuration parameters can be set in several ways.

MODULE START FUNCTION

The start function of a module can be specified at the same time as the module declaration.

greple -Mannotate::config(align=0)

greple -Mannotate::config=align=80

PRIVATE MODULE OPTION

Module-specific options are specified between -Mannotate and --.

greple -Mannotate --config align=80 -- ...

greple -Mannotate --align=80 -- ...

CONFIGURATION PARAMETERS

align

(default 1) Align the description on the rightmost column, or numbered column if the value is greater than 2.

INSTALL

cpanm -n App::Greple::annotate

SEE ALSO

App::Greple

App::Greple::charcode

LICENSE

Copyright︎ ©︎ 2025 Kazumasa Utashiro.

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

AUTHOR

Kazumasa Utashiro