[zsh] Fix the nethack function so it only triggers a remote session if you ask for it
This commit is contained in:
parent
79757c36a2
commit
f392afe533
1 changed files with 7 additions and 8 deletions
|
@ -6,6 +6,7 @@ function nethack
|
||||||
local remote
|
local remote
|
||||||
while getopts 'lr' opt; do
|
while getopts 'lr' opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
|
h) echo "Usage: $0 [-l][-r]";;
|
||||||
l) remote=0;;
|
l) remote=0;;
|
||||||
r) remote=1;;
|
r) remote=1;;
|
||||||
*)
|
*)
|
||||||
|
@ -15,17 +16,15 @@ function nethack
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if (( $remote )) && binary_exists nethack; then
|
if (( $remote )); then
|
||||||
ssh nethack@alt.org
|
ssh nethack@alt.org
|
||||||
return $?
|
return $?
|
||||||
|
elif binary_exists nethack; then
|
||||||
|
command nethack "$@[$OPTIND,-1]"
|
||||||
|
return $?
|
||||||
else
|
else
|
||||||
if binary_exists nethack; then
|
ssh nethack@alt.org
|
||||||
command nethack
|
return $?
|
||||||
return $?
|
|
||||||
else
|
|
||||||
ssh nethack@alt.org
|
|
||||||
return $?
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue