#!/usr/bin/perl

###############################################################################
# Required inclusions.
###############################################################################
use strict;
use warnings;
use Alien::scriptaculous;
use Getopt::Long;
use Pod::Usage;

###############################################################################
# Read in our command line arguments.
###############################################################################
my $quiet;
my ($help, $man);
GetOptions(
    'quiet'     => \$quiet,
    'help|?'    => \$help,
    'man'       => \$man,
    ) || pod2usage(1);
pod2usage(1) if ($help);
pod2usage( -exitstatus=>0, -verbose=>2 ) if ($man);

my $dir = shift || './scriptaculous';

###############################################################################
# Install script.aculo.us.
###############################################################################
print "Installing script.aculo.us to $dir\n" unless ($quiet);
Alien::scriptaculous->install( $dir );
print "... done\n" unless ($quiet);

=head1 NAME

scriptaculous-install - minimal script.aculo.us installation

=head1 SYNOPSIS

  scriptaculous-install [options] destdir

  Options:
    --quiet     Install quietly; only report errors
    --help/-?   Brief help message
    --man       Full documentation
    destdir     Directory to install to (default "./scriptaculous")

=head1 DESCRIPTION

Performs a minimal installation of script.aculo.us, by installing just the
JavaScript files into the specified F<destdir>, using C<Alien::scriptaculous>.

=head1 OPTIONS

=over

=item B<--quiet>

Install quietly; only error messages will be displayed.

=item B<--help/-?>

Displays a brief help message.

=item B<--man>

Displays the full documenation.

=item B<destdir>

Directory that the script.aculo.us JS library should be installed into.
Defaults to F<./scriptaculous>.

=back

=head1 AUTHOR

Graham TerMarsch (cpan@howlingfrog.com)

=head1 LICENSE

Copyright (C) 2006-2007, Graham TerMarsch.  All rights reserved.

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

=head1 SEE ALSO

L<Alien::scriptaculous>.

=cut
