summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoretienne2002-09-20 08:22:03 +0000
committeretienne2002-09-20 08:22:03 +0000
commit4159141904cc5f5a516787501222667b8f4f24c0 (patch)
treefea819cc7a256f7a14c2500716d01e37657cd653 /src
parent833e1a3d0f5e0ddb91fef2683059616d5065ff36 (diff)
downloadivymon-4159141904cc5f5a516787501222667b8f4f24c0.zip
ivymon-4159141904cc5f5a516787501222667b8f4f24c0.tar.gz
ivymon-4159141904cc5f5a516787501222667b8f4f24c0.tar.bz2
ivymon-4159141904cc5f5a516787501222667b8f4f24c0.tar.xz
L'option -bus est supportée
Il n'y a plus de vérification du format de l'adresse réseau.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ivymon21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/ivymon b/src/ivymon
index 90b5435..24ce804 100755
--- a/src/ivymon
+++ b/src/ivymon
@@ -14,7 +14,7 @@ use Carp;
use strict 'vars';
use Getopt::Long;
use Tk::CmdLine;
-use vars qw/$opt_help $opt_b $opt_history @opt_bind @opt_send/;
+use vars qw/$opt_help $opt_b $opt_bus $opt_history @opt_bind @opt_send/;
# geometry
my $minW = 1050;
@@ -86,13 +86,6 @@ my @send_def;
# Rejeu available (not effective) bindings array
my @bind_def;
-#for (@bind_def) {
- # s/\=\s+/\=\.\* /g;
- # s/\=\s*$/=\.\*/g;
- # s/^(.*)$/\(^$1\)/;
-#
-#}
-
# Effective bindings array
my @effectivebind;
@@ -104,9 +97,9 @@ my @effectivebind;
Tk::CmdLine::SetArguments(-font => '7x14');
Tk::CmdLine::SetArguments();
-if (not GetOptions('-help', '-history=s', '-b=s', '-bind=s@',
+if (not GetOptions('-help', '-history=s', '-b=s', '-bus=s', '-bind=s@',
'-send=s@') or $opt_help) {
- print "Usage: ivymon [-b bus] [-help] [-history length]\n";
+ print "Usage: ivymon [-b[us] bus] [-help] [-history length]\n";
print " [-bind regexp1] ... [-bind regexpN] \n";
print " [-send message1] ... [-send messageN] \n";
print " [standard X11 options...]\n";
@@ -121,9 +114,11 @@ if (not GetOptions('-help', '-history=s', '-b=s', '-bind=s@',
exit ;
}
-
-$ivy_port = $opt_b if $opt_b and
- $opt_b =~ /^(\d+\.\d+\.\d+\.\d+)?(,\d+\.\d+\.\d+\.\d+)*:\d+/;
+if ($opt_bus) {
+ $ivy_port = $opt_bus;
+} elsif ($opt_b) {
+ $ivy_port = $opt_b;
+}
$history = $opt_history if $opt_history;
my $title;
if ($ivy_port) {