#!/usr/bin/env perl
package sprunge;
use perl5i::2;
# ABSTRACT: command-line read-write access to sprunge.us
our $VERSION = '0.006'; # VERSION

use App::Pastebin::sprunge;
use Getopt::Long;
use Pod::Usage;

my %opts = ();
GetOptions( \%opts,
    'help|?',
    'version',
    'lang|syntax=s',
);

pod2usage(
    -verbose => 2,
) if $opts{help};


if (delete $opts{version}) {
    my $this = __PACKAGE__;
    my $this_ver = __PACKAGE__->VERSION();
    say "$this version $this_ver" and exit;
}

App::Pastebin::sprunge->new()->run($opts{lang});

__END__
=pod

=encoding utf-8

=head1 NAME

sprunge - command-line read-write access to sprunge.us

=head1 VERSION

version 0.006

=head1 SYNOPSIS

    sprunge --lang lang < file
    ps aux | sprunge
    sprunge ID
    sprunge --help

=head1 DESCRIPTION

B<sprunge> is a simple command line program to write to (and read from)
the pastebin L<http://sprunge.us>.

=head2 Writing

Provide input on stdin to B<sprunge> to paste it to the pastebin. Provide the
B<--lang> option to specify syntax highlighting to apply.

    ps aux | sprunge
    sprunge --lang pl < file.pl

=head2 Reading

Run sprunge with a URL or paste ID to output the text to stdout.

    sprunge H2gc | less

=head1 OPTIONS

=over 4

=item B<--help>, -h, -?

Opens this man page and exits.

=item B<--version>

Prints the version of this program and supporting libraries.

=item B<--lang>, --syntax

Specifies the syntax highlighting type to use. sprunge.us allows any syntax
highlighting available from L<Pygments|http://pygments.org/> to be applied
to any paste, so you can change this at any time by altering the URI parameter.

=back

=head1 AVAILABILITY

The project homepage is L<http://p3rl.org/App::Pastebin::sprunge>.

The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit L<http://www.perl.com/CPAN/> to find a CPAN
site near you, or see L<http://search.cpan.org/dist/App-Pastebin-sprunge/>.

The development version lives at L<http://github.com/doherty/App-Pastebin-sprunge>
and may be cloned from L<git://github.com/doherty/App-Pastebin-sprunge.git>.
Instead of sending patches, please fork this project using the standard
git and github infrastructure.

=head1 SOURCE

The development version is on github at L<http://github.com/doherty/App-Pastebin-sprunge>
and may be cloned from L<git://github.com/doherty/App-Pastebin-sprunge.git>

=head1 BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests through the web interface at
L<https://github.com/doherty/App-Pastebin-sprunge/issues>.

=head1 AUTHOR

Mike Doherty <doherty@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Mike Doherty.

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

=cut

