diff options
author | David Paleino <dapal@debian.org> | 2013-04-05 12:55:51 +0200 |
---|---|---|
committer | David Paleino <dapal@debian.org> | 2013-04-05 12:55:51 +0200 |
commit | 09dbe3eeb2e9695d171a63e14361c4099b5be978 (patch) | |
tree | 69f099aab27e28b832e627de51ed2b99e3d7445c /completions/pkg-config | |
parent | 0d099a545fed933f329f434a43b58edcb52d366c (diff) | |
parent | 3085c7e12179817a02a611016606391295c69942 (diff) | |
download | bash-completion-09dbe3eeb2e9695d171a63e14361c4099b5be978.tar.gz |
Merge branch 'master' into 2.x2.x
Diffstat (limited to 'completions/pkg-config')
-rw-r--r-- | completions/pkg-config | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/completions/pkg-config b/completions/pkg-config index 0156c0dd..f861c30e 100644 --- a/completions/pkg-config +++ b/completions/pkg-config @@ -6,11 +6,23 @@ _pkg_config() _init_completion -s || return case $prev in - --variable|--define-variable|--atleast-version|--atleast-pkgconfig-version| \ + --define-variable|--atleast-version|--atleast-pkgconfig-version| \ --exact-version|--max-version) # argument required but no completions available return 0 ;; + --variable) + local i + for (( i=1; i < ${#words[@]}; i++ )); do + if [[ ${words[i]} != -* ]]; then + COMPREPLY=( $( compgen -W \ + '$( "$1" ${words[i]} --print-variables 2>/dev/null )' \ + -- "$cur" ) ) + break + fi + done + return 0 + ;; -\?|--help|--version|--usage) # all other arguments are noop with these return 0 |