summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xxsh11
1 files changed, 5 insertions, 6 deletions
diff --git a/xsh b/xsh
index 630709c..74d32a9 100755
--- a/xsh
+++ b/xsh
@@ -25,15 +25,14 @@ SUDO=''
X=''
V=''
HOST=''
-ssh_opts="-t"
-
+PORT=''
while [ $# -gt 0 ]; do
case $1 in
su) SU=1; SUDO=;;
sudo) SUDO=1; SU=;;
- --x|-x|x) X=1; ssh_opts="$ssh_opts -X";;
- --verbose|-v) V=1; ssh_opts="$ssh_opts -v";;
- --port|-p) ssh_opts="$ssh_opts -p $2"; shift;;
+ --x|-x|x) X=1;;
+ --verbose|-v) V=1;;
+ --port|-p) PORT="$2"; shift;;
--) shift; break;;
-*) usage; exit 1;;
@*) HOST=${1#@};;
@@ -54,6 +53,6 @@ done
# FIXME: needs shell wrapper (provided by SSH but not in local use)
[ -z "$V" ] || set -- "$@"\; sleep 4
-[ -z "$HOST" ] || set -- ssh $ssh_opts $HOST "$@"
+[ -z "$HOST" ] || set -- ssh -t${X:+ -X}${V:+ -v}${PORT:+ -p "$PORT"} $HOST "$@"
termwrapper "$@"