From d14eb673b9037782610d9b6da560d376f487943f Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Sat, 27 Jul 2024 18:27:10 +0200 Subject: [PATCH] fix(zsh): apply formatting --- .zshrc | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.zshrc b/.zshrc index 67caf1e..20d035a 100644 --- a/.zshrc +++ b/.zshrc @@ -93,33 +93,32 @@ function set_terminal_title() { function precmd() { set_terminal_title } -# function preexec() { set_terminal_title "$1" } function ssh_with_title() { local host="" local skip_next="false" - + for arg in "$@"; do case "$arg" in - -[bcDeFIiLlmOopRSWw]?*) - # Option with argument immediately after, like -p22 + -[bcDeFIiLlmOopRSWw]?*) + # 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" - ;; - -[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" - else - host="${arg#*@}" - fi - ;; + else + host="${arg#*@}" + fi + ;; esac done