#!perl
use strict;
require App::perlbrew;

my $app = App::perlbrew->new(@ARGV);
$app->run();

__END__

=head1 NAME

perlbrew - Perl Environment manager.

=head1 SYNOPSIS

    perlbrew <command> [options] [arguments]

    Commonly used commands:
        init           Initialize perlbrew environment.
        install        Install perl
        list           List installed perls
        use            Use the specified perl in current shell
        switch         Permanently use the specified perl as default
        mirror         Pick a preffered mirror site
        off            Permanently turn off perlbrew
        version        Display version
        help           Read more detail instructions

    Examples:
        perlbrew install perl-5.12.2
        perlbrew install perl-5.13.6

        perlbrew list

        perlbrew use perl-5.13.6
        perlbrew switch perl-5.12.2

=head1 COMMANDS

=over 4

=item B<init>

Run this once to setup the C<perlbrew> directory ready for installing
perls into. Run it again if you decide to change C<PERLBREW_ROOT>.

=item B<mirror>

Run this if you want to choose a specific CPAN mirror to install the
perls from. It will display a list of mirrors for you to pick
from. Hit 'q' to cancel the selection.

=item B<install> perl-<version>

Build and install the given version of perl.

=item B<install> /path/to/perl/git/checkout/dir

Build and install from the given git checkout dir.

=item B<list>

List the installed versions of perl.

=item B<use> perl-<version>

Notice: this only works in bash and zsh.

Switch to the given version of perl only in the current shell. This
will not effect newly opened shells.

=item B<switch> perl-<version>

Switch to the given version. You may need to run 'rehash' (or 'hash
-r') after this command.

=item B<version>

Show the version of perbrew.

=item B<off>

Disable perlbrew. Use C<switch> command to re-enable it.

=item B<env>

Low-level command. Use this command to see the list of environment
variables that are set by C<perlbrew> itself for bash integration.

The output is something similar to this:

    export PERLBREW_ROOT=/Users/gugod/perl5/perlbrew
    export PERLBREW_VERSION=0.13
    export PERLBREW_PATH=/Users/gugod/perl5/perlbrew/bin

=item B<symlink_executables> <perl-version>

Low-level command. Use this command to create the C<perl> executable
symbolic link to C<perl5.13.6>.

You don't need to do this unless you were using old perlbrew to
install perls. The installation layout is changed since version 0.11.

If you just upgraded perlbrew and found C<perlbrew switch> failed to work
after you switch to a development release of perl, say, perl-5.13.6, run this command:

    perlbrew symlink_executables perl-5.13.6

This essentially creates this symlink:

   ${PERLBREW_ROOT}/perls/perl-5.13.6/bin/perl
   -> ${PERLBREW_ROOT}/perls/perl-5.13.6/bin/perl5.13.6

=item B<install-cpanm>

Install the C<cpanm> standalone executable in C<$PERLBREW_ROOT/bin>.

=back

=head1 OPTIONS

=over 4

=item B<-h| --help>

prints this help.

=item B<-f| --force>

Force installation of a perl.

=item B<-n| --notest>

Skip the test suite

=item B<-q| --quiet>

Log output to a log file rather than STDOUT. This is the default. The log file is saved in F<$ROOT/build.log>

=item B<-v| --verbose>

Log output to STDOUT rather than a logfile.

=item B<--as>

Install a given perl under an alias.

    perlbrew install perl-5.6.2 --as legacy-perl

=item B<-D>, B<-U>, B<-A>

pass through switches to the perl Configure script.

    perlbrew install perl-5.10.1 -D usemymalloc -U uselargefiles

=back

=head1 CONFIGURATION

=over 4

=item PERLBREW_ROOT

By default, perlbrew builds and installs perls into
C<$ENV{HOME}/perl5/perlbrew> directory. To use a different directory,
set this environment variable in your C<bashrc> to the directory
before running perlbrew.

=back

=head1 SEE ALSO

L<App::perlbrew>, L<App::cpanminus>

=cut
