summaryrefslogtreecommitdiff
path: root/completions/xmllint
diff options
context:
space:
mode:
authorDavid Paleino <dapal@debian.org>2011-11-03 12:32:52 +0100
committerDavid Paleino <dapal@debian.org>2011-11-03 12:32:52 +0100
commit2c8171c38d87ddef31c92a76547d3fdf773a1337 (patch)
tree5e720d5a06ead72ed55454bf6647a712a761ed91 /completions/xmllint
parent9920a8faedf704420571d8072ccab27e9dac40ba (diff)
downloadbash-completion-2c8171c38d87ddef31c92a76547d3fdf773a1337.tar.gz
Imported Upstream version 1.90upstream/1.90
Diffstat (limited to 'completions/xmllint')
-rw-r--r--completions/xmllint22
1 files changed, 6 insertions, 16 deletions
diff --git a/completions/xmllint b/completions/xmllint
index 5b9c301c..c29c52d8 100644
--- a/completions/xmllint
+++ b/completions/xmllint
@@ -1,12 +1,9 @@
-# bash completion for xmllint(1)
+# bash completion for xmllint(1) -*- shell-script -*-
-have xmllint &&
_xmllint()
{
- local cur prev
-
- COMPREPLY=()
- _get_comp_words_by_ref cur prev
+ local cur prev words cword
+ _init_completion || return
case $prev in
-o|--output)
@@ -36,20 +33,13 @@ _xmllint()
esac
if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( xmllint --help 2>&1 | \
- sed -ne "s/^[[:space:]]*\(--[^[:space:]:]*\).*/\1/p" ) \
- -o' -- "$cur" ) )
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ COMPREPLY=( "${COMPREPLY[@]%:}" )
return 0
fi
- _filedir '@(*ml|htm|svg|xs[dl]|rng|wsdl|jnlp)?(.gz)'
+ _filedir '@(*ml|htm|svg|xs[dl]|rng|wsdl|jnlp|tld)?(.gz)'
} &&
complete -F _xmllint xmllint
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
# ex: ts=4 sw=4 et filetype=sh