diff options
-rw-r--r-- | completions/bash/apt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/completions/bash/apt b/completions/bash/apt index 94ad974b1..f60f9e97c 100644 --- a/completions/bash/apt +++ b/completions/bash/apt @@ -67,8 +67,9 @@ _apt() ;; esac - # supported options per command - if [[ "$cur" == -* ]]; then + # When the cursor (cword) is before the command word (i), only suggest + # options but not package or file names: + if [[ $cur == -* || ( -v command && $cword -le $i ) ]]; then case ${command-} in install|remove|purge|upgrade|dist-upgrade|full-upgrade|autoremove) COMPREPLY=( $( compgen -W '--show-progress @@ -167,6 +168,8 @@ _apt() return 0 ;; esac + + return fi # specific command arguments |