diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/ivymon | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -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) { |