App-lms
view release on metacpan or search on metacpan
uses C<--style=header,grid,snip>. For C<less>, C<--number> adds
C<-N> option.
=item B<-r>, B<--raw>
Show raw paths without resolving Homebrew wrapper scripts to
their actual executables.
=item B<-v>, B<--version>
Display version information and exit.
=item B<-p>, B<--pager> I<command>
Specify the pager command to use for displaying files.
Defaults to the C<$LMS_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:
- C<Command>: Search for executable commands in C<$PATH>
- C<Perl>: Search for Perl modules in C<@INC>
- C<Python>: Search for Python libraries using Python's inspect module
- C<Ruby>: Search for Ruby libraries using C<$LOADED_FEATURES>
- C<Node>: Search for Node.js modules using C<require.resolve>
Examples:
lms --type Perl Getopt::Long # Only search Perl modules
lms --type python json # Only search Python modules
lms --type ruby yaml # Only search Ruby libraries
lms --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: C<.optex.d/bin> (or C<$OPTEX_BINDIR> if set)
=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::lms::Command>
Handler for executable commands. Searches through C<$PATH> environment
variable to find executable files.
=item B<App::lms::Perl>
Handler for Perl modules. Searches through C<@INC> paths to find
Perl module files (.pm and .pl files).
=item B<App::lms::Python>
Handler for Python libraries. Executes Python's C<inspect.getsourcefile()>
function to locate Python module files.
=item B<App::lms::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::lms::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>.
=back
=head1 EXAMPLES
# Display a script command (brew is a shell script)
lms brew
# Display a Perl module
lms List::Util
( run in 2.061 seconds using v1.01-cache-2.11-cpan-f56aa216473 )