From: Felix Kästner Date: Fri, 27 Aug 2021 12:22:07 +0000 (+0200) Subject: clean the code for _tssh_completion function X-Git-Url: https://fpunktk.de/gitweb/?a=commitdiff_plain;h=e56de3b0fd460a76b34b2b76f7499302acbd0cdf;p=travelrc.git clean the code for _tssh_completion function --- diff --git a/README.md b/README.md index dde0ade..992ad74 100644 --- a/README.md +++ b/README.md @@ -101,9 +101,14 @@ tssh() { ssh -t "$@" "$(trccmd --xz)" } _tssh_completion() { - # when completion is requested, it will be redefined to use _ssh and then load the completion function for ssh, see https://stackoverflow.com/questions/61539494/how-does-bash-do-ssh-autocompletion - complete -F _ssh tssh - __load_completion "ssh" && return 124 || complete -r tssh # if loading completion is successful then return, otherwise disable completion for tssh + # when completion is requested, load completion for ssh and use it for tssh, otherwise disable completion for tssh + # see https://stackoverflow.com/questions/61539494/how-does-bash-do-ssh-autocompletion + if __load_completion "ssh"; then + complete -F _ssh tssh + return 124 + else + complete -r tssh + fi } complete -F _tssh_completion tssh # this just loads the correct completion function