--- a/bin/rpi Mon Sep 19 12:00:37 2011 +0200
+++ b/bin/rpi Mon Sep 19 12:12:37 2011 +0200
@@ -1,13 +1,34 @@
#!/usr/bin/perl
+=encoding utf8
+
+=cut
+
use warnings;
use strict;
use IO::File;
use IPC::Run qw(run);
+use Getopt::Long;
use Mail::Sendmail;
+use Pod::Usage;
use Sys::Hostname::Long;
+GetOptions(
+ "h|help" => sub { pod2usage(-exit => 0, -verbose => 1) },
+ "m|man" => sub {
+ pod2usage(
+ -exit => 0,
+ -verbose => 2,
+
+ # "system('perldoc -V &>/dev/null')" appears shorter, but may not
+ # do what you expect ( it still returns 0 on debian squeeze with
+ # dash as system shell even if cannot find the command in $PATH)
+ -noperldoc => system('perldoc -V >/dev/null 2>&1')
+ );
+ }
+) or pod2usage;
+
my $hostname = hostname_long;
for (*STDERR, *STDOUT) { select $_; $|=1; }
@@ -367,6 +388,13 @@
rpi - a wrapper around B<reprepro processincoming>
+=head1 SYNOPSIS
+
+rpi
+
+rpi -m|--man
+ -h|--help
+
=head1 DESCRIPTION
Until B<reprepro> supports a better mechanism for sending notifications for
@@ -385,4 +413,8 @@
C<$fallback> address. Anything matching none of the defined patterns will be
sent to the C<$fallback> address too. Everything will be printed to stdout.
+=head1 AUTHORS
+
+Matthias Förste L<<foerste@schlittermann.de>>
+
=cut