#!perl

# NO_PERINCI_CMDLINE_SCRIPT
# FRAGMENT id=shcompgen-hint command=_cpanm

our $DATE = '2018-02-18'; # DATE
our $VERSION = '0.003'; # VERSION

use strict;
use warnings;
use File::Which;

my $cpanm_path = which("cpanm") or die "Can't find cpanm in PATH\n";

my @cmd = (
    $^X,
    "-MModule::Load::In::INIT=App::cpanminus::script::Patch::RunShcompgen=-load_target;0;-warn_target_loaded;0",
    "-MModule::Load::In::INIT=App::cpanminus::script::Patch::UseURIFromFoundMirror=-load_target;0;-warn_target_loaded;0",
    $cpanm_path,
    @ARGV,
);

print "cpanm-perlancar: exec: ".join(" ", @cmd), "\n" if $ENV{DEBUG};
exec @cmd;

# ABSTRACT: Install modules from CPAN (PERLANCAR's flavor)
# PODNAME: cpanm-perlancar

__END__

=pod

=encoding UTF-8

=head1 NAME

cpanm-perlancar - Install modules from CPAN (PERLANCAR's flavor)

=head1 VERSION

This document describes version 0.003 of cpanm-perlancar (from Perl distribution App-cpanm-perlancar), released on 2018-02-18.

=head1 SYNOPSIS

Use like you would use L<cpanm>:

 % cpanm-perlancar -n Some::Module ...

To alias it as C<cpanm> in your shell, e.g. in bash:

 alias cpanm=cpanm-perlancar

=head1 DESCRIPTION

L<cpanm-perlancar> is a wrapper over L<cpanm>. It runs cpanm patched with some
patches (see the source for more details).

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/App-cpanm-perlancar>.

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-App-cpanm-perlancar>.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=App-cpanm-perlancar>

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=head1 SEE ALSO

L<cpanm>

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2018, 2017 by perlancar@cpan.org.

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

=cut
