From 092652424fab8004907f87472cc795fb527ee20b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 12 Oct 2013 20:55:58 +1300 Subject: Use default completion on empty COMPREPLY --- bash/bashrc.d/ftp.bash | 3 ++- bash/bashrc.d/mysql.bash | 3 ++- bash/bashrc.d/ssh.bash | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'bash') diff --git a/bash/bashrc.d/ftp.bash b/bash/bashrc.d/ftp.bash index e46cc474..04518b5f 100644 --- a/bash/bashrc.d/ftp.bash +++ b/bash/bashrc.d/ftp.bash @@ -5,6 +5,7 @@ _ftp() { # Bail if the .netrc file is illegible local netrc=$HOME/.netrc if [[ ! -r $netrc ]]; then + COMPREPLY=() return 1 fi @@ -27,5 +28,5 @@ _ftp() { # Generate completion reply COMPREPLY=( $(compgen -W "${machines[*]}" -- "$word") ) } -complete -F _ftp ftp +complete -F _ftp -o default ftp diff --git a/bash/bashrc.d/mysql.bash b/bash/bashrc.d/mysql.bash index 992d342c..391c130d 100644 --- a/bash/bashrc.d/mysql.bash +++ b/bash/bashrc.d/mysql.bash @@ -30,6 +30,7 @@ _mysql() { files=("$dir"/*.cnf) ((! ${#files[@]})) ); then + COMPREPLY=() return 1 fi @@ -40,5 +41,5 @@ _mysql() { items=("${items[@]%%.cnf}") COMPREPLY=( $(compgen -W "${items[*]}" -- "$word") ) } -complete -F _mysql mysql +complete -F _mysql -o default mysql diff --git a/bash/bashrc.d/ssh.bash b/bash/bashrc.d/ssh.bash index 6ce73d24..9eaf4389 100644 --- a/bash/bashrc.d/ssh.bash +++ b/bash/bashrc.d/ssh.bash @@ -5,6 +5,7 @@ _ssh() { # Bail if the configuration file is illegible local config=$HOME/.ssh/config if [[ ! -r $config ]]; then + COMPREPLY=() return 1 fi @@ -20,5 +21,5 @@ _ssh() { # Generate completion reply COMPREPLY=( $(compgen -W "${hosts[*]}" -- "$word") ) } -complete -F _ssh ssh sftp ssh-copy-id +complete -F _ssh -o default ssh sftp ssh-copy-id -- cgit v1.2.3