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 / xmllint < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.1 KB  |  56 lines

  1. # bash completion for xmllint(1)
  2.  
  3. have xmllint &&
  4. _xmllint()
  5. {
  6.     local cur prev
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur prev
  10.  
  11.     case $prev in
  12.         -o|--output)
  13.             _filedir
  14.             return 0
  15.             ;;
  16.         --path|--dtdvalidfpi|--maxmem|--encode|--pattern)
  17.             # argument required but no completions available
  18.             return 0
  19.             ;;
  20.         --dtdvalid)
  21.             _filedir dtd
  22.             return 0
  23.             ;;
  24.         --relaxng)
  25.             _filedir rng
  26.             return 0
  27.             ;;
  28.         --schema)
  29.             _filedir xsd
  30.             return 0
  31.             ;;
  32.         --schematron)
  33.             _filedir sch
  34.             return 0
  35.             ;;
  36.     esac
  37.  
  38.     if [[ "$cur" == -* ]]; then
  39.         COMPREPLY=( $( compgen -W '$( xmllint --help 2>&1 | \
  40.             sed -ne "s/^[[:space:]]*\(--[^[:space:]:]*\).*/\1/p" ) \
  41.             -o' -- "$cur" ) )
  42.         return 0
  43.     fi
  44.  
  45.     _filedir '@(*ml|htm|svg)'
  46. } &&
  47. complete -F _xmllint -o filenames xmllint
  48.  
  49. # Local variables:
  50. # mode: shell-script
  51. # sh-basic-offset: 4
  52. # sh-indent-comment: t
  53. # indent-tabs-mode: nil
  54. # End:
  55. # ex: ts=4 sw=4 et filetype=sh
  56.