summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org>2022-01-25 15:57:22 +0100
committerJörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org>2022-01-26 21:26:48 +0100
commitca5557936211bd670a203e6e1f8d75fda2d61819 (patch)
tree2a0249d346326f88690c2b2ff83aa6f05596492a
parent969349ce82ef6fbb1f65e875eeab84c403f23c88 (diff)
Bash-complete either package name or .deb filename for `apt install`
Should provide a tiny speed-up when someone already started typing either one in the current argument.
-rw-r--r--completions/bash/apt5
1 files changed, 3 insertions, 2 deletions
diff --git a/completions/bash/apt b/completions/bash/apt
index 0e5d6f808..61101d839 100644
--- a/completions/bash/apt
+++ b/completions/bash/apt
@@ -189,10 +189,11 @@ _apt()
return 0
;;
install)
- COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
- 2> /dev/null ) )
if [[ "$cur" == ./* || "$cur" == /* || "$cur" == ~* ]]; then
_filedir "deb"
+ else
+ COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
+ 2> /dev/null ) )
fi
return 0
;;