From: martin f. krafft Date: Mon, 30 Mar 2020 04:37:22 +0000 (+1300) Subject: display error if sshproxy functions get no arguments X-Git-Url: https://git.madduck.net/etc/ssh.git/commitdiff_plain/1fa53ea94c453ef12f3fbf238d740f4914367d40?hp=6b87f90ed79ac94c90e92e6cb01b0fbd0bf9e577 display error if sshproxy functions get no arguments --- diff --git a/.zsh/zshrc/parts.d/50-ssh b/.zsh/zshrc/parts.d/50-ssh index 8ece86b..0e6e62c 100644 --- a/.zsh/zshrc/parts.d/50-ssh +++ b/.zsh/zshrc/parts.d/50-ssh @@ -20,6 +20,7 @@ _ssh_proxy() { local cmd sshopts cmdopts cmd="$1"; shift sshopts="${*%%--*}"; sshopts="${sshopts%% }" + [[ -n "$sshopts" ]] || { ssh; return $? } cmdopts="${*#$sshopts}"; cmdopts="${cmdopts#*-- }" eval ssh $sshopts -t $cmd $cmdopts }