--- a/tele-watch.pl Sun Mar 01 12:52:25 2009 +0100
+++ b/tele-watch.pl Sun Mar 01 13:13:40 2009 +0100
@@ -56,16 +56,15 @@
"m|man" => sub { pod2usage(-exitval => 0, -verbose => 3) },
"block!" => \$opt_block,
"daemon!" => \$opt_daemon,
- "kill" => \$opt_kill,
+ "k|kill" => \$opt_kill,
+ "v|version" => \$opt_version,
"pidfile=s" => \$opt_pidfile,
- )
- and @ARGV
- or pod2usage();
+ ) or pod2usage();
if ($opt_kill) {
- die "$ME: Not killing anything, no pid file.\n";
+ die "$ME: Not killing anything, no pid file.\n" if not $opt_pidfile;
my $pid = readf($opt_pidfile);
- die "$ME: not killing anything, no pid.\n";
+ die "$ME: not killing anything, no pid.\n" if not defined $pid;
kill TERM => $pid
or die "$ME: can't kill $pid: $!\n";
print "$ME: sent TERM signal to $pid\n";
@@ -73,10 +72,11 @@
}
if ($opt_version) {
- print "$ME:\n$VERSION";
+ print "$ME: $VERSION";
exit 0;
}
+ pod2usage() if not @ARGV;
foreach (@ARGV) {
my ($w, $t, $r) = split /:/;
die "$ME: too many \":\" in \"$_\"\n" if defined $r;
@@ -383,6 +383,8 @@
Heiko Schlittermann <hs@schlittermann.de>.
The source may be found at L<https://keller.schlittermann.de/hg/ius/tele-watch>.
+=head1 VERSION
+
<VERSION>