#!/usr/bin/env perl

use strict;
use warnings;

use File::Basename 'dirname';
use File::Spec::Functions qw/catdir splitdir/;

# Source directory has precedence
my @base = (splitdir(dirname(__FILE__)), '..');
my $lib = join('/', @base, 'lib');
-e catdir(@base, 't') ? unshift(@INC, $lib) : push(@INC, $lib);

# Check if Mojolicious is installed
die <<EOF unless eval 'use Mojolicious::Commands; 1';
It looks like you don't have the Mojolicious framework installed.
Please visit http://mojolicio.us for detailed installation instructions.

EOF

# "My eyes! The goggles do nothing!"
Mojolicious::Commands->start;

__END__

=head1 NAME

mojo - The Mojolicious command system

=head1 SYNOPSIS

  $ mojo --help

=head1 DESCRIPTION

List and run L<Mojolicious> commands as described in
L<Mojolicious::Commands>.

=head1 SEE ALSO

L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.

=cut
