diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-12-20 08:18:54 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-12-20 08:18:54 +0100 |
commit | fe39b8eadd1eaf633faed90a5a59d9418f1be57b (patch) | |
tree | fc4a2734a3883240ea25f1899c8b17128b72b497 /debian | |
parent | a21e3947d29c946bccd6a5c7872845cb7af5c6d2 (diff) |
bash completion: complete filenames on hooks, cleaners and builders
Diffstat (limited to 'debian')
-rw-r--r-- | debian/gbp.completion | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/debian/gbp.completion b/debian/gbp.completion index 0b103993..1f7f484b 100644 --- a/debian/gbp.completion +++ b/debian/gbp.completion @@ -53,6 +53,9 @@ _gbp_comp () local tristate_opts=${4:-"--color\="} local cbdist_opts=${5:-"--git-dist\="} local remote_config_opts="--remote-config\=" + local file_opts="--postimport\= --git-builder\= --git-cleaner\= \ + --git-export-dir\= --git-postbuild\= --git-postexport\= \ + --git-posttag\= --git-prebuild\= --git-tarball-dir\=" local start_opt="" # COMPREPLY considers '=' as a word. For $prev we prefer the word before the actual "=" @@ -93,6 +96,11 @@ _gbp_comp () return 0 fi + if [[ "${file_opts}" == *$prev* ]]; then + COMPREPLY=( $(compgen -f -- $cur ) ) + return 0 + fi + # separate opts by tab so we can append a space to all options not ending # with an equal sign tab_opts=$(echo "$options" | sed -e 's/ \+/\t/g' -e 's/[^=]$/& /g') |