fix(zsh): apply formatting

This commit is contained in:
Oscar Wallberg
2024-07-27 18:27:10 +02:00
parent 0c6034ffea
commit d14eb673b9
+19 -20
View File
@@ -93,33 +93,32 @@ function set_terminal_title() {
function precmd() { function precmd() {
set_terminal_title set_terminal_title
} }
# function preexec() { set_terminal_title "$1" }
function ssh_with_title() { function ssh_with_title() {
local host="" local host=""
local skip_next="false" local skip_next="false"
for arg in "$@"; do for arg in "$@"; do
case "$arg" in case "$arg" in
-[bcDeFIiLlmOopRSWw]?*) -[bcDeFIiLlmOopRSWw]?*)
# Option with argument immediately after, like -p22 # Option with argument immediately after, like -p22
skip_next="false"
;;
-[bcDeFIiLlmOopRSWw])
# Option with argument on next iteration
skip_next="true"
;;
-*)
# Any other option, assumed not to take an argument
skip_next="false"
;;
*)
if [ "$skip_next" = "true" ]; then
skip_next="false" skip_next="false"
;; else
-[bcDeFIiLlmOopRSWw]) host="${arg#*@}"
# Option with argument on next iteration fi
skip_next="true" ;;
;;
-*)
# Any other option, assumed not to take an argument
skip_next="false"
;;
*)
if [ "$skip_next" = "true" ]; then
skip_next="false"
else
host="${arg#*@}"
fi
;;
esac esac
done done