diff --git a/completions/.gitignore b/completions/.gitignore index 582188ac..427fdff6 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -1,4 +1,3 @@ -a2x aclocal-1.11 alpine alternatives diff --git a/completions/Makefile.am b/completions/Makefile.am index 2c58235a..cf809096 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -1,5 +1,6 @@ bashcompdir = $(pkgdatadir)/completions -bashcomp_DATA = abook \ +bashcomp_DATA = a2x \ + abook \ aclocal \ add_members \ alias \ @@ -327,7 +328,6 @@ EXTRA_DIST = $(bashcomp_DATA) \ _mock _modules _subversion _yum _yum-utils CLEANFILES = \ - a2x \ aclocal-1.11 \ alpine \ alternatives \ @@ -514,7 +514,7 @@ symlinks: rm -f $(targetdir)/$$file && \ $(LN_S) ant $(targetdir)/$$file ; \ done - for file in a2x asciidoc.py ; do \ + for file in asciidoc.py ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) asciidoc $(targetdir)/$$file ; \ done diff --git a/completions/a2x b/completions/a2x new file mode 100644 index 00000000..7c330908 --- /dev/null +++ b/completions/a2x @@ -0,0 +1,40 @@ +# a2x(1) completion -*- shell-script -*- + +_a2x() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -a|--attribute|--asciidoc-opts|--dblatex-opts|--fop-opts|-h|--help|\ + --version|--xsltproc-opts) + return + ;; + -D|--destination-dir|--icons-dir) + _filedir -d + return + ;; + --doctype|-d) + _xfunc asciidoc _asciidoc_doctype + return + ;; + --stylesheet) + _filedir css + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir +} && +complete -F _a2x a2x + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/asciidoc b/completions/asciidoc index 9f4a94e0..722614f6 100644 --- a/completions/asciidoc +++ b/completions/asciidoc @@ -49,42 +49,4 @@ _asciidoc() } && complete -F _asciidoc asciidoc asciidoc.py - -_a2x() -{ - local cur prev words cword split - _init_completion -s || return - - case $prev in - -a|--attribute|--asciidoc-opts|--dblatex-opts|--fop-opts|-h|--help|\ - --version|--xsltproc-opts) - return - ;; - -D|--destination-dir|--icons-dir) - _filedir -d - return - ;; - --doctype|-d) - _asciidoc_doctype - return - ;; - --stylesheet) - _filedir css - return - ;; - esac - - $split && return - - if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' \ - -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - return - fi - - _filedir -} && -complete -F _a2x a2x - # ex: ts=4 sw=4 et filetype=sh