From f7d62ea425b7d092dccbab2afecadaf976c8a659 Mon Sep 17 00:00:00 2001 From: Xavier Berger Date: Sat, 7 Sep 2013 10:24:20 +0200 Subject: [PATCH] add -s ption to show internal condiguration --- rpimonitor/rpimonitord | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rpimonitor/rpimonitord b/rpimonitor/rpimonitord index 19ed798..629ecbd 100755 --- a/rpimonitor/rpimonitord +++ b/rpimonitor/rpimonitord @@ -124,7 +124,7 @@ sub Load -destroy => 'no' ) or die $!; - if ( $this->{'test'} ) { + if ( $this->{'show'} ) { die Data::Dumper->Dump([$this]); } } @@ -628,8 +628,9 @@ OPTIONS -h, --help Shows this help and exit -n, --noserver Don't start embeded server -p, --port Web server port (Default: 8888) - -v, --verbose Write debug info on screen + -s, --show Show configuration as loaded and exit -t, --timeout KPI read timeout in seconds (Default: 5) + -v, --verbose Write debug info on screen -V, --Version Show version and exit CONFIGURATION @@ -719,9 +720,9 @@ while($_ = shift) /-h(elp)?/ and help; /-n(oserver)?/ and $configuration->{'daemon'}->{'noserver'}++ and next; /-p(ort)?/ and $configuration->{'daemon'}->{'port'} = shift and next; - /-t(est)?/ and $configuration->{'test'}++ and next; + /-s(how)?/ and $configuration->{'show'}++ and next; + /-t(imeout)?/ and $configuration->{'daemon'}->{'timeout'} = shift and next; /^-([v]+)$/ and $verbose = length $1 and next; - /^-t(imeout)$/ and $configuration->{'daemon'}->{'timeout'} = shift and next; /-V(ersion)?/ and die "$0 version $VERSION\n"; } $configuration->Load();