Unverified Commit 7cb8f64b authored by Gavin Brown's avatar Gavin Brown
Browse files

add --help

parent 21d3f487
...@@ -7,6 +7,7 @@ use List::MoreUtils qw(any); ...@@ -7,6 +7,7 @@ use List::MoreUtils qw(any);
use MIME::Base64; use MIME::Base64;
use Net::DNS; use Net::DNS;
use POSIX qw(setsid); use POSIX qw(setsid);
use Pod::Usage;
use Sys::Syslog qw(:standard :macros); use Sys::Syslog qw(:standard :macros);
use URI; use URI;
use strict; use strict;
...@@ -17,14 +18,18 @@ my $addr = '127.0.0.1'; ...@@ -17,14 +18,18 @@ my $addr = '127.0.0.1';
my $port = '8080'; my $port = '8080';
my $raddr = '127.0.0.1'; my $raddr = '127.0.0.1';
my $daemon = undef; my $daemon = undef;
my $help = undef;
GetOptions( GetOptions(
'addr=s' => \$addr, 'addr=s' => \$addr,
'port=i' => \$port, 'port=i' => \$port,
'resolver=s' => \$raddr, 'resolver=s' => \$raddr,
'debug' => \$HTTP::Daemon::DEBUG, 'debug' => \$HTTP::Daemon::DEBUG,
'daemon' => \$daemon, 'daemon' => \$daemon,
'help' => \$help,
); );
pod2usage(1) if ($help);
my $resolver = Net::DNS::Resolver->new( my $resolver = Net::DNS::Resolver->new(
'nameservers' => [ $raddr ], 'nameservers' => [ $raddr ],
'debug' => $HTTP::Daemon::DEBUG, 'debug' => $HTTP::Daemon::DEBUG,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment