home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / configure < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.1 KB  |  45 lines

  1. # bash completion for configure
  2.  
  3. _configure()
  4. {
  5.     local cur prev split=false
  6.  
  7.     COMPREPLY=()
  8.     _get_comp_words_by_ref cur prev
  9.  
  10.     _split_longopt && split=true
  11.  
  12.     case $prev in
  13.         --prefix|--exec-prefix|--*dir)
  14.             _filedir -d
  15.             ;;
  16.     esac
  17.  
  18.     $split && return 0
  19.  
  20.     # if $COMP_CONFIGURE_HINTS is not null, then completions of the form
  21.     # --option=SETTING will include 'SETTING' as a contextual hint
  22.     [[ "$cur" != -* ]] && return 0
  23.  
  24.     if [ -n "$COMP_CONFIGURE_HINTS" ]; then
  25.         COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
  26.             awk '/^  --[A-Za-z]/ { print $1; \
  27.             if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \
  28.             -- "$cur" ) )
  29.     else
  30.         COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
  31.             awk '/^  --[A-Za-z]/ { print $1; \
  32.             if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' )" \
  33.             -- "$cur" ) )
  34.     fi
  35. }
  36. complete -F _configure -o filenames configure
  37.  
  38. # Local variables:
  39. # mode: shell-script
  40. # sh-basic-offset: 4
  41. # sh-indent-comment: t
  42. # indent-tabs-mode: nil
  43. # End:
  44. # ex: ts=4 sw=4 et filetype=sh
  45.