From c49ee156ba68b4e52c7fdef91e4212595681efa5 Mon Sep 17 00:00:00 2001 From: "Jan M. Hochstein" Date: Fri, 12 Sep 2014 11:02:08 +0200 Subject: [PATCH] Improved option handling --- onvif/scripts/zmonvif-probe.pl | 47 +++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/onvif/scripts/zmonvif-probe.pl b/onvif/scripts/zmonvif-probe.pl index b8c006d00..fb550f475 100755 --- a/onvif/scripts/zmonvif-probe.pl +++ b/onvif/scripts/zmonvif-probe.pl @@ -24,6 +24,8 @@ # This module contains the implementation of the ONVIF capability prober # +use Getopt::Std; + require ONVIF::Client; require WSDiscovery::Interfaces::WSDiscovery::WSDiscoveryPort; @@ -272,14 +274,53 @@ sub metadata } +# ======================================================================== +# options processing + +$Getopt::Std::STANDARD_HELP_VERSION = 1; + +our ($opt_v); + +my $OPTIONS = "v"; + +sub HELP_MESSAGE +{ + my ($fh, $pkg, $ver, $opts) = @_; + print $fh "Usage: " . __FILE__ . " [-v] probe \n"; + print $fh " " . __FILE__ . " [-v] \n"; + print $fh <