/bash_completion_lib/complete/pkg-config

http://github.com/brinkman83/bashrc · #! · 32 lines · 24 code · 8 blank · 0 comment · 0 complexity · ea4e976fb49f7395cfe2d8c6800626ba MD5 · raw file

  1. # pkgconfig(1) completion
  2. comp_include _get_cword
  3. _pkg_config()
  4. {
  5. local cur
  6. COMPREPLY=()
  7. cur=`_get_cword`
  8. if [[ "$cur" == -* ]]; then
  9. # return list of available options
  10. COMPREPLY=( $( compgen -W '-version --modversion \
  11. --atleast-pkgconfig-version= --libs --libs-only-l \
  12. --libs-only-other --libs-only-L --cflags \
  13. --cflags-only-I --cflags-only-other --variable= \
  14. --define-variable= --exists --uninstalled \
  15. --atleast-version= --exact-version= --max-version= \
  16. --list-all --debug --print-errors --silence-errors \
  17. --errors-to-stdout -? --help --usage' -- $cur))
  18. else
  19. COMPREPLY=( $( pkg-config --list-all 2>/dev/null | \
  20. awk '{print $1}' | grep "^$cur" ) )
  21. fi
  22. } # _pkg_config()
  23. comp_install -F _pkg_config # Make completion persistent for subsequent invocations
  24. _pkg_config # Generate completions for first invocation