[zsh] Move func/ directory to zsh/functions

This commit is contained in:
Eryn Wells 2026-01-18 08:43:02 -07:00
parent 91da2fc583
commit 7c08c5131f
53 changed files with 1 additions and 1 deletions

31
zsh/functions/nethack Normal file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
function nethack
{
local remote
while getopts 'lr' opt; do
case $opt in
h) echo "Usage: $0 [-l][-r]";;
l) remote=0;;
r) remote=1;;
*)
echo "Invalid argument: $OPTARG" 1>&2
return -1
;;
esac
done
if (( $remote )); then
ssh nethack@alt.org
return $?
elif binary_exists nethack; then
command nethack "$@[$OPTIND,-1]"
return $?
else
ssh nethack@alt.org
return $?
fi
}
nethack "$@"