From d7f8465d51306c2e1539117e0d7f1dc066bbe1e3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 1 Dec 2018 02:04:41 +1300 Subject: Use full `if` condition for SSH hostname comp src --- bash/bash_completion.d/sftp.bash | 3 ++- bash/bash_completion.d/ssh-copy-id.bash | 3 ++- bash/bash_completion.d/ssh.bash | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bash/bash_completion.d/sftp.bash b/bash/bash_completion.d/sftp.bash index ad4d406f..b54b06b7 100644 --- a/bash/bash_completion.d/sftp.bash +++ b/bash/bash_completion.d/sftp.bash @@ -1,4 +1,5 @@ # Completion for sftp(1) with ssh_config(5) hostnames -declare -F _ssh_config_hosts >/dev/null || +if ! declare -F _ssh_config_hosts >/dev/null ; then source "$HOME"/.bash_completion.d/_ssh_config_hosts.bash +fi complete -F _ssh_config_hosts -o bashdefault -o default sftp diff --git a/bash/bash_completion.d/ssh-copy-id.bash b/bash/bash_completion.d/ssh-copy-id.bash index 336df4ea..cbecfa5f 100644 --- a/bash/bash_completion.d/ssh-copy-id.bash +++ b/bash/bash_completion.d/ssh-copy-id.bash @@ -1,4 +1,5 @@ # Completion for ssh-copy-id(1) with ssh_config(5) hostnames -declare -F _ssh_config_hosts >/dev/null || +if ! declare -F _ssh_config_hosts >/dev/null ; then source "$HOME"/.bash_completion.d/_ssh_config_hosts.bash +fi complete -F _ssh_config_hosts -o bashdefault -o default ssh-copy-id diff --git a/bash/bash_completion.d/ssh.bash b/bash/bash_completion.d/ssh.bash index 7ec82596..6d327c91 100644 --- a/bash/bash_completion.d/ssh.bash +++ b/bash/bash_completion.d/ssh.bash @@ -1,4 +1,5 @@ # Completion for ssh(1) with ssh_config(5) hostnames -declare -F _ssh_config_hosts >/dev/null || +if ! declare -F _ssh_config_hosts >/dev/null ; then source "$HOME"/.bash_completion.d/_ssh_config_hosts.bash +fi complete -F _ssh_config_hosts -o bashdefault -o default ssh -- cgit v1.2.3