#!/usr/bin/env perl

use strict;
use warnings;

use App::Wax;

$| = 1; # unbuffer output
my $wax = App::Wax->new();
exit $wax->run(\@ARGV);

__END__

=head1 NAME

wax - Webify Your CLI

=head1 USAGE

    wax [OPTIONS] program [OPTIONS] ...

=head1 SYNOPSIS

    $ wax grep needle http://www.haysta.ck
    $ wax espeak -f http://www.setec.org/mel.txt

    $ alias perldoc="wax perldoc"
    $ perldoc -F "http://www.pair.com/~comdog/brian's_guide.pod"

=head1 DESCRIPTION

C<wax> is a simple command-line program that runs other command-line programs and converts their URI
arguments to file paths. The remote resources are saved as temporary files, which are
cleaned up after the waxed program has exited.

=head1 OPTIONS

The following wax options can be supplied before the command name. Subsequent options are passed to
the waxed program verbatim, apart from URIs, which are converted to paths to the corresponding temporary
files. To exclude args from waxing, pass them after C<--> e.g.

    wax --timeout 5 command -f http://example.com -- --title http://www.example.com

=head2 -d, --debug

Print diagnostic information to STDERR.

=head2 -h, -?, --help

Display this documentation.

=head2 -t, --timeout INTEGER

Set the timeout for HTTP requests in seconds. Default: 5.

=head2 -u, --user-agent STRING

Set the user-agent string for HTTP requests.

=head1 CAVEATS

As with any command-line programs that take URI parameters, care should be taken to ensure that
special shell characters are suitably quoted. As a general rule, URIs that contain C<&>, C<~>,
C<<>, C<>>, C<$> &c. should be single- or double-quoted in Unix-like shells and double-quoted with embedded
escapes in Windows C<cmd/command.exe>-like shells.

It's worth checking that a program actually needs waxing. Many command-line programs already support URIs:

    vim http://www.vim.org/
    gedit http://projects.gnome.org/gedit/
    eog http://upload.wikimedia.org/wikipedia/commons/4/4c/Eye_of_GNOME.png
    gimp http://upload.wikimedia.org/wikipedia/commons/6/6c/Gimpscreen.png

&c.

=head1 SEE ALSO

=over

=item * rlwrap

=item * sshfs

=back

=head1 AUTHOR

chocolateboy, <chocolate@cpan.org>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2010-2011 by chocolateboy

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.1 or,
at your option, any later version of Perl 5 you may have available.

=cut
