summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org>2022-01-26 21:36:24 +0100
committerJörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org>2022-01-26 21:36:24 +0100
commit4ff687f8c8e09ebcbd96e9542625b6b32280e1c3 (patch)
tree42e9161a0b2759012d2648e2a20b63db1e7b00b6
parent2c793d2083e6e16509f61cb5b1b38b0884515838 (diff)
Provide bash-completion of .dsc filenames for `apt build-dep`
Closes: #985899
-rw-r--r--completions/bash/apt10
1 files changed, 7 insertions, 3 deletions
diff --git a/completions/bash/apt b/completions/bash/apt
index 7cf54df1f..f50636776 100644
--- a/completions/bash/apt
+++ b/completions/bash/apt
@@ -197,9 +197,13 @@ _apt()
return 0
;;
source|build-dep|showsrc|policy)
- COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
- 2> /dev/null ) $( apt-cache dumpavail | \
- command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) )
+ if [[ "$command" == build-dep && ( "$cur" == .* || "$cur" == /* || "$cur" == ~* ) ]]; then
+ _filedir "dsc"
+ else
+ COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
+ 2> /dev/null ) $( apt-cache dumpavail | \
+ command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) )
+ fi
return 0
;;
edit-sources)