App-chot

 view release on metacpan or  search on metacpan

script/chot  view on Meta::CPAN


Use L<nup|App::nup> for multi-column display.
If I<N> is specified, it is passed to C<nup> as the number of columns.

    chot -C greple           # multi-column with default layout
    chot -C2 greple          # 2-column layout

The source files are shown with syntax highlighting and formatted
into multi-column pages, equivalent to C<nup chot greple>.

=item B<-p>, B<--pager> I<command>

Specify the pager command to use for displaying files.
Defaults to the C<$CHOT_PAGER> environment variable, or C<bat> if available,
otherwise C<less>.

When multiple files are found, C<bat> displays all files continuously
with syntax highlighting. With C<less>, use C<:n> to navigate to the
next file and C<:p> for the previous file.

=item B<-t>, B<--type> I<handler[:handler:...]>

Specify which file type handlers to use and in what order.
Handlers are specified as colon-separated names (case-insensitive).

Default: C<Command:Perl:Python:Ruby:Node>

Available handlers:

    Command   Search for executable commands in $PATH
    Perl      Search for Perl modules in @INC
    Python    Search for Python libraries using inspect module
    Ruby      Search for Ruby libraries using $LOADED_FEATURES
    Node      Search for Node.js modules using require.resolve

Examples:

    chot --type Perl Getopt::Long       # Only search Perl modules
    chot --type python json             # Only search Python modules
    chot --type ruby yaml               # Only search Ruby libraries
    chot --type node express            # Only search Node.js modules

=item B<--py>

Shortcut for C<--type Python>. Search only Python modules.

=item B<--pl>

Shortcut for C<--type Perl>. Search only Perl modules.

=item B<--rb>

Shortcut for C<--type Ruby>. Search only Ruby libraries.

=item B<--nd>

Shortcut for C<--type Node>. Search only Node.js modules.

=item B<--bat-theme> I<mode>=I<theme>

Specify the default bat theme for light or dark terminal backgrounds.
Can be used multiple times.

    --bat-theme light=GitHub --bat-theme dark=Monokai

If C<bat> is used as the pager and C<BAT_THEME> is not set, the
terminal background luminance is detected and the appropriate theme
is applied.  Built-in defaults are C<Coldark-Cold> for light and
C<Coldark-Dark> for dark backgrounds.

=item B<--suffix> I<extension>

Specify file suffix/extension to search for (mainly for Perl modules).

Default: C<.pm>

=item B<--skip> I<pattern>

Specify directory patterns to skip during search.
Can be used multiple times to specify multiple patterns.

Default: none (optex symlinks are resolved automatically)

=back

=head1 HANDLER MODULES

The program uses a plugin architecture where different file type handlers
are dynamically loaded based on the C<--type> option. Each handler must
implement a C<get_path($app, $name)> method.

=over 7

=item B<App::chot::Command>

Handler for executable commands. Searches through C<$PATH> environment
variable to find executable files.

For L<optex|App::optex> symlinks (commands that are symlinks pointing
to the C<optex> binary), the handler resolves them to the actual
command by searching C<$PATH> (skipping other optex symlinks). If the
command has an alias defined in C<~/.optex.d/config.toml>, the alias
target is used for resolution. When a C<~/.optex.d/NAME.rc>
configuration file exists, it is included in the results.

=item B<App::chot::Perl>

Handler for Perl modules. Searches through C<@INC> paths to find
Perl module files (.pm and .pl files).

=item B<App::chot::Python>

Handler for Python libraries. Executes Python's C<inspect.getsourcefile()>
function to locate Python module files.  When the default C<python3>
cannot find a module, falls back to interpreters discovered from
shebang lines of previously found paths (e.g., Homebrew venv Python).

=item B<App::chot::Ruby>

Handler for Ruby libraries. Loads the specified library with C<require>
and inspects C<$LOADED_FEATURES> to find the actual file path.
Documentation is displayed using C<ri>.

=item B<App::chot::Node>

Handler for Node.js modules. Uses C<require.resolve> with global paths
to locate module entry points.
Documentation is opened via C<npm docs>.



( run in 1.369 second using v1.01-cache-2.11-cpan-f56aa216473 )