From: Andrew Ruthven Date: Thu, 29 Nov 2007 19:16:59 +0000 (+1300) Subject: Let Getopt::Long do the input validation for port. X-Git-Tag: 0.6.0~23 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24d6bd69dc6ec0152aaf21a1e09a930c517b743d;p=mythtv-status.git Let Getopt::Long do the input validation for port. --- diff --git a/bin/mythtv-status b/bin/mythtv-status index cc674fc..cdd7100 100755 --- a/bin/mythtv-status +++ b/bin/mythtv-status @@ -38,7 +38,7 @@ GetOptions( 'd|descripton' => \$description, 'e|episode' => \$episode, 'h|host=s' => \$host, - 'p|port=s' => \$port, + 'p|port=i' => \$port, 'v|version' => \&print_version, 'email=s@' => \@email, 'email-only-on-conflict' => \$email_only_on_conflict, @@ -61,9 +61,6 @@ GetOptions( pod2usage(verbose => 1) if defined $help; -die "Sorry, port isn't a number.\n" - if $port !~ /^\d+$/; - # Get the email address into a format we can use. @email = split(',', join(',', @email));