summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-11-01 22:23:33 +0200
committerVille Skyttä <ville.skytta@iki.fi>2011-11-01 22:25:41 +0200
commit66fc912020a594270c213e2eff6f6b9c5f6489b1 (patch)
tree6b4baab488c9ed80ad167c6085f24f217650d51b
parent52bdba591a4b22dc17e3b2f8a31060022df9cc45 (diff)
downloadbash-completion-66fc912020a594270c213e2eff6f6b9c5f6489b1.tar.gz
a2x: Split from asciidoc into separate file.
-rw-r--r--completions/.gitignore1
-rw-r--r--completions/Makefile.am6
-rw-r--r--completions/a2x40
-rw-r--r--completions/asciidoc38
4 files changed, 43 insertions, 42 deletions
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