From 4ff687f8c8e09ebcbd96e9542625b6b32280e1c3 Mon Sep 17 00:00:00 2001 From: Jörn-Thorben Hinz <11910-jth@users.noreply.salsa.debian.org> Date: Wed, 26 Jan 2022 21:36:24 +0100 Subject: Provide bash-completion of .dsc filenames for `apt build-dep` Closes: #985899 --- completions/bash/apt | 10 +++++++--- 1 file 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) -- cgit v1.2.3-70-g09d2