From e0c19ee620c53b52ca7cf69c19d414d782338be1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 10 May 2020 21:35:07 +0200 Subject: Add completion for paths --- misc/bash/completion.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'misc/bash') diff --git a/misc/bash/completion.sh b/misc/bash/completion.sh index 097353b50..93298c369 100644 --- a/misc/bash/completion.sh +++ b/misc/bash/completion.sh @@ -1,6 +1,14 @@ function _complete_nix { + local have_type while IFS= read -r line; do - COMPREPLY+=("$line") + if [[ -z $have_type ]]; then + have_type=1 + if [[ $line = filenames ]]; then + compopt -o filenames + fi + else + COMPREPLY+=("$line") + fi done < <(NIX_GET_COMPLETIONS=$COMP_CWORD "${COMP_WORDS[@]}") } -- cgit v1.2.3