App-Pastebin-sprunge

 view release on metacpan or  search on metacpan

bin/sprunge  view on Meta::CPAN

#!/usr/bin/env perl
package sprunge;
use strict;
use warnings;
use v5.10.1;
use App::Pastebin::sprunge;
use Getopt::Long;
use Pod::Usage;

# ABSTRACT: command-line read-write access to sprunge.us
our $VERSION = '0.012'; # VERSION

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.012

=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



( run in 4.532 seconds using v1.01-cache-2.11-cpan-4ac696b4eb4 )