diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2011-01-02 23:49:58 +0200 |
---|---|---|
committer | Ville Skyttä <ville.skytta@iki.fi> | 2011-01-02 23:49:58 +0200 |
commit | d37b36605e4f7b12e079d37d5a60598a12fb57bb (patch) | |
tree | efad368d09e835662e6abb53ebb30f31747dd6c0 | |
parent | 24a37fc8405c811d22369e1a7cce08605c324941 (diff) | |
download | bash-completion-d37b36605e4f7b12e079d37d5a60598a12fb57bb.tar.gz |
Do _filedir in _command_offset only for commands with no completions installed.
If we have a completion installed for the actual command invoked via
sudo etc, it is very much possible and fine that no completions are
returned from it, and doing _filedir in these cases is not the right
thing to do.
-rw-r--r-- | bash_completion | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bash_completion b/bash_completion index e4787f20..61d450c9 100644 --- a/bash_completion +++ b/bash_completion @@ -1527,10 +1527,10 @@ _command_offset() cspec=${cspec%%${cmd##*/}}; COMPREPLY=( $( eval compgen "$cspec" -- "$cur" ) ); fi + elif [ ${#COMPREPLY[@]} -eq 0 ]; then + _filedir fi fi - - [ ${#COMPREPLY[@]} -eq 0 ] && _filedir } complete -F _command aoss command do else eval exec ltrace nice nohup padsp \ then time tsocks vsound xargs |