NAME
App::Greple::annotate - greple module for generic annotation
SYNOPSIS
greple -Mannotate [ module option ] -- [ command option ] ...
VERSION
Version 0.9906
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. - --annotate::config=params
-
Set configuration paarameters.
MODULE OPTIONS and PARAMS
- --config=params
-
Set configuration parameters.
- --alignto=column
- config(alignto=column)
-
Align annotation messages. Defaults to
1
, which aligns to the rightmost column;0
means no align; if a value of2
or greater is given, it aligns to that numbered column.column can be negative; if
-1
is specified, align to the same column for all lines. If-2
is specified, align to the longest line length, regardless of match position. - --split, --no-split
- config(split=[#])
-
Defaults to
0
. If a pattern matching multiple characters is given, annotate each character individually.
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
andmatch
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(alignto=0)
greple -Mannotate::config=alignto=80
PRIVATE MODULE OPTION
Module-specific options are specified between -Mannotate
and --
.
greple -Mannotate --config alignto=80 -- ...
greple -Mannotate --alignto=80 -- ...
GENERIC MODULE OPTION
Module-specific ---config
option can be called by normal command line option --annotate::config
.
greple -Mannotate --annotate::config alignto=80 ...
INSTALL
cpanm -n B<App::Greple::annotate>
SEE ALSO
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