#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;

use App::Rakubrew;


my $app = App::Rakubrew->new(@ARGV);
$app->run_script();


__END__

=head1 NAME

rakubrew - Raku environment manager

=head1 SYNOPSIS

 rakubrew version          # or rakubrew current
 rakubrew versions         # or rakubrew list
 rakubrew global [version] # or rakubrew switch [<version>]
 rakubrew shell [--unset|<version>]
 rakubrew local [<version>]
 rakubrew nuke [<version>] # or rakubrew unregister [<version>]
 rakubrew rehash

 rakubrew available        # or rakubrew list-available
 rakubrew build [<backend>] [<tag>|<branch>|<sha-1>] [--configure-opts=<options>]
 rakubrew triple [<rakudo-version> [<nqp-version> [<moar-version>]]]
 rakubrew register <name> <path>
 rakubrew build-zef [<zef-version>]
 rakubrew download [<backend>] [<rakudo-version>]

 rakubrew exec <executable> [<executable-args>]
 rakubrew which <executable>
 rakubrew whence [--path] <executable>
 rakubrew mode [env|shim]
 rakubrew self-upgrade
 rakubrew init

 rakubrew test [<version>|all]

 rakubrew help [--verbose|<command>]
 rakubrew home
 rakubrew rakubrew-version


=head1 COMMAND: version

Usage: rakubrew version|current <version>

Show the currently active Rakudo version.

=head1 COMMAND: current

Usage: rakubrew version|current <version>

Show the currently active Rakudo version.

=head1 COMMAND: versions

Usage: rakubrew versions|list <version>

List all installed Rakudo installations.
The currently active Rakudo installation is marked with a star at the beginning
of the line.

=head1 COMMAND: list

Usage: rakubrew versions|list <version>

List all installed Rakudo installations.
The currently active Rakudo installation is marked with a star at the beginning
of the line.

=head1 COMMAND: global

Usage: rakubrew global|switch <version>

Show or set the globally configured Rakudo version.

=head1 COMMAND: switch

Usage: rakubrew global|switch <version>

Show or set the globally configured Rakudo version.

=head1 COMMAND: shell

Usage: rakubrew shell [--unset|<version>]

Show, set or unset the shell version.

=head1 COMMAND: local

Usage: rakubrew local [--unset|<version>]

Show, set or unset the local version.

=head1 COMMAND: nuke

Usage: rakubrew nuke|unregister [<version>]

Removes an installed or registered version. Versions built by rakubrew are
actually deleted, registered versions are only unregistered but not deleted.

=head1 COMMAND: unregister

Usage: rakubrew nuke|unregister [<version>]

Removes an installed or registered version. Versions built by rakubrew are
actually deleted, registered versions are only unregistered but not deleted.

=head1 COMMAND: rehash

Usage: rakubrew rehash

Regenerate all shims. Newly installed scripts will not work unless this is
called. This is only necessary in C<shim> mode.

=head1 COMMAND: available

Usage: rakubrew available|list-available

List all Rakudo versions that can be installed.
Installed versions will be marked with an asterisk at the beginning of the line.
Releases marked with a 'D' have a precompiled archive available and can be
downloaded and installed without compilation with the C<download> subcommand.

=head1 COMMAND: list-available

Usage: rakubrew available|list-available

List all Rakudo versions that can be installed.
Installed versions will be marked with an asterisk at the beginning of the line.
Releases marked with a 'D' have a precompiled archive available and can be
downloaded and installed without compilation with the C<download> subcommand.

=head1 COMMAND: build-rakudo

Usage: rakubrew build[-rakudo] [<backend>] [<tag>|<branch>|<sha-1>] [--configure-opts=<options>]

Download, compile and install a rakudo version.
Please note that this can take a while, be patient.

The arguments are:

=over

=item *

The backend

=over

=item *

C<moar-blead> is the moar and nqp backends at their main branch.

=item *

C<all> will build all backends.

=back

=item *

The version to build. Call C<available> to see a list of available
versions. When left empty the latest release is built.
It is also possible to specify a tag, branch name or commit sha to build.

=item *

Configure options.

=back

=head1 COMMAND: triple

Usage: rakubrew triple [<rakudo-version> [<nqp-version> [<moar-version>]]]

Build a specific set of Rakudo, NQP and MoarVM commits. If you don't specify a
version the latest one will be used.

=head1 COMMAND: register

Usage: rakubrew register <name> <path>

Register an externaly built / installed Rakudo version with rakubrew.

=head1 COMMAND: build-zef

Usage: rakubrew build-zef [<zef-version>]

Install Zef (at the given version) into the current Rakudo version.

=head1 COMMAND: download-rakudo

Usage: rakubrew download[-rakudo] [<backend>] [<rakudo-version>]

Download and install a precompiled release archive.

=head1 COMMAND: exec

Usage: rakubrew exec <executable> [<executable-args>]

Explicitly call an executable. You normally shouldn't need to do this.

=head1 COMMAND: which

Usage: rakubrew which <executable>

Show the full path of the executable.

=head1 COMMAND: whence

Usage: rakubrew whence [--path] <executable>

List all versions that contain the given executable. when C<--path> is given the
path of the executables is given instead.

=head1 COMMAND: mode

Usage: rakubrew mode [env|shim]

Show or set the mode of operation.

=head1 COMMAND: self-upgrade

Usage: rakubrew self-upgrade

Upgrade rakubrew itself.

=head1 COMMAND: init

Usage: rakubrew init

Show installation instructions.

=head1 COMMAND: test

Usage: rakubrew test [<version>|all]

Run Rakudo tests aka C<make test> in the current, given or all installed
versions.

=head1 COMMAND: help

Usage: rakubrew help [--verbose|<command>]

Display an overview of rakubrew commands.
Add a specific command to display instructions for that command.
Print the entire manual with the C<--verbose> flag.

=head1 COMMAND: home

Usage: rakubrew home

Display the currently configured rakubrew home directory.

=head1 COMMAND: rakubrew-version

Usage: rakubrew rakubrew-version

Display the version of this rakubrew installation and some other information
helpful for debugging. Include this information when you report a bug.

=cut