App-PMUtils

 view release on metacpan or  search on metacpan

script/pmdir  view on Meta::CPAN

Perinci::CmdLine::Any->new(
    url => '/App/PMUtils/pmdir',
    read_config => 0,
    read_env => 0,
)->run;

# ABSTRACT: Get directory of locally installed Perl module/prefix
# PODNAME: pmdir

__END__

=pod

=encoding UTF-8

=head1 NAME

pmdir - Get directory of locally installed Perl module/prefix

=head1 VERSION

This document describes version 0.745 of pmdir (from Perl distribution App-PMUtils), released on 2024-08-30.

=head1 SYNOPSIS

This is basically a shortcut for:

 % pmpath -Pd MODULE_OR_PREFIX_NAME

It's just that sometimes I forgot that L<pmpath> has a C<-d> option, and
often intuitively look for a C<pmdir> command.

Basic usage:

 % cd `pmdir Pod::Weaver`

Works with prefix too:

 % cd `pmdir Dist::Zilla::Plugin`
 % cd `pmdir Dist::Zilla::Plugin::`

=head1 DESCRIPTION

=for BEGIN_BLOCK: protip_cdpm

Pro-tip: install this bash function to be able to cd quickly to directory of
Perl module/prefix (tab completion is also provided):

 # function definition
 cdpm ()
 {
     if [[ "$1" = "" ]]; then echo "Please specify a Perl module/prefix name"; return; fi
     local dir=`pmdir "$1"`
     if [[ "$dir" = "" ]]; then echo "Failed"; else cd "$dir"; fi
 }
 
 # tab completion
 _cdpm ()
 {
     local cur=${COMP_WORDS[COMP_CWORD]}
     COMPREPLY=( `COMP_LINE="pmdir $cur" COMP_POINT=$[6+${#cur}] pmdir` )
 }
 
 # activate tab completion
 complete -F _cdpm cdpm

Afterwards, you can:

 % cdpm di/zi/pl<tab>
 % cdpm Dist/Zilla/Plugin/ _

=for END_BLOCK: protip_cdpm

=head1 OPTIONS

C<*> marks required options.

=head2 Main options

=over

=item B<--abs>, B<-P>

Absolutify each path.

=item B<--module-json>=I<s>

See C<--module>.

Can also be specified as the 1st command-line argument and onwards.

=item B<--module>=I<s@>

(No description)


Can also be specified as the 1st command-line argument and onwards.

Can be specified multiple times.

=item B<--pm>=I<s>

Default value:

 1

=item B<--pmc>=I<s>

Default value:

 0

=item B<--pod>=I<s>

Default value:

 0

=back

=head2 Output options



( run in 1.428 second using v1.01-cache-2.11-cpan-5735350b133 )