Ticket #520: nopaste.patch

File nopaste.patch, 1.0 KB (added by fperrad, 13 years ago)

example with tools/dev/nopaste.pl

  • nopaste.pl

     
    99 
    1010use WWW::Mechanize; 
    1111use Getopt::Std; 
     12use Pod::Usage; 
    1213 
    1314 
    1415my $server  = 'nopaste.snit.ch'; 
     
    2122 
    2223getopt( 'c:n:t:', $opt ); 
    2324 
    24 usage() 
     25pod2usage(2) 
    2526    unless defined $opt->{t}; 
    2627 
    2728 
     
    5152print "Your paste can be found at ", $link[0]->url, "\n"; 
    5253 
    5354 
    54 sub usage { 
    55     print <<USAGE; 
    56 nopaste.pl - paste the contents of a file via $server 
    57  
    58   nopaste.pl -t "TITLE" [ -c CHANNEL ] [ -n NAME ] [ FILENAME ] 
    59  
    60     TITLE     the title of the paste 
    61     CHANNEL   the irc channel (defaults to #parrot) 
    62     NAME      the username (defaults to username or 'someone') 
    63     FILENAME  the name of the file to paste (defaults to STDIN) 
    64 USAGE 
    65     exit 0; 
    66 } 
    67  
    68 ########## DOCUMENTATION ########## 
    69  
    7055=head1 NAME 
    7156 
    7257tools/dev/nopaste.pl - paste the contents of a file via a pastebot server