From acc9df43fc635f2cf2cf3a0e0a88d8803743cc77 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 16 Nov 1996 16:30:12 +0000 Subject: [PATCH] Add options: -l username, -t args_to_telnet, and -x args_to_xterm git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@975 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/kx/rxtelnet.in | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/appl/kx/rxtelnet.in b/appl/kx/rxtelnet.in index e15cf26f8..7be457d0d 100644 --- a/appl/kx/rxtelnet.in +++ b/appl/kx/rxtelnet.in @@ -1,12 +1,24 @@ #!/bin/sh # $Id$ +# +usage="Usage: $0 [-l username] [-t args_to_telnet] [-x args_to_xterm] host" +while true +do + case $1 in + -l) telnet_args="${telnet_args} -l $2 "; title="${2}@"; shift 2;; + -t) telnet_args="${telnet_args} $2 "; shift 2;; + -x) xterm_args="${xterm_args} $2 "; shift 2;; + -*) echo "$0: Bad option $1"; echo $usage; exit 1;; + *) break;; + esac +done if test $# -lt 1; then - echo "Usage: $0 host [arguments to telnet]" + echo $usage exit 1 fi host=$1 +title="${title}${host}" shift -telnet_args=$* bindir=%bindir% pdc_trams=`dirname $0` PATH=$pdc_trams:$bindir:$PATH @@ -32,7 +44,7 @@ for i in $*; do done done if test -n "$term"; then - ($term -title $host -name $host -e env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host; kill -USR2 $pid) & + ($term -title $title -name $title $xterm_args -e env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host; kill -USR2 $pid) & else env DISPLAY=$disp XAUTHORITY=$auth telnet -D $telnet_args $host kill -USR2 $pid