[Bash-completion-commits] [bash-completion] 01/04: _*: Install our deprecated completions too, try loading them secondarily
Ville Skyttä
scop-guest at moszumanska.debian.org
Sat Feb 8 17:36:02 UTC 2014
This is an automated email from the git hooks/post-receive script.
scop-guest pushed a commit to branch master
in repository bash-completion.
commit e201d1be7ed92bf35c249d6d01c4001378e0ed77
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sat Feb 8 15:33:10 2014 +0200
_*: Install our deprecated completions too, try loading them secondarily
---
bash_completion | 12 +--
completions/Makefile.am | 24 +++---
completions/{_yum-utils => _repomanage} | 0
completions/{_subversion => _svn} | 131 --------------------------------
completions/_svnadmin | 79 +++++++++++++++++++
completions/_svnlook | 64 ++++++++++++++++
6 files changed, 163 insertions(+), 147 deletions(-)
diff --git a/bash_completion b/bash_completion
index da9af6b..a63315a 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1944,12 +1944,14 @@ complete -F _minimal ''
# set up dynamic completion loading
_completion_loader()
{
- local compfile=./completions
- [[ $BASH_SOURCE == */* ]] && compfile="${BASH_SOURCE%/*}/completions"
- compfile+="/${1##*/}"
+ local compdir=./completions compfile
+ [[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions"
- # Avoid trying to source dirs; https://bugzilla.redhat.com/903540
- [[ -f "$compfile" ]] && . "$compfile" &>/dev/null && return 124
+ for compfile in "${1##*/}" _"${1##*/}"; do
+ compfile="$compdir/$compfile"
+ # Avoid trying to source dirs; https://bugzilla.redhat.com/903540
+ [[ -f "$compfile" ]] && . "$compfile" &>/dev/null && return 124
+ done
# Need to define *something*, otherwise there will be no completion at all.
complete -F _minimal "$1" && return 124
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 3fa38db..44b07d7 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -130,6 +130,7 @@ bashcomp_DATA = 2to3 \
hping2 \
htop \
htpasswd \
+ _hwclock \
iconv \
id \
idn \
@@ -141,6 +142,7 @@ bashcomp_DATA = 2to3 \
installpkg \
interdiff \
invoke-rc.d \
+ _ionice \
ip \
iperf \
ipmitool \
@@ -210,8 +212,10 @@ bashcomp_DATA = 2to3 \
mkinitrd \
mktemp \
mmsitepass \
+ _mock \
modinfo \
modprobe \
+ _modules \
monodevelop \
mount \
mount.linux \
@@ -234,6 +238,7 @@ bashcomp_DATA = 2to3 \
newusers \
ngrep \
nmap \
+ _nmcli \
nslookup \
ntpdate \
openssl \
@@ -289,6 +294,7 @@ bashcomp_DATA = 2to3 \
remove_members \
removepkg \
renice \
+ _repomanage \
reportbug \
reptyr \
resolvconf \
@@ -303,6 +309,7 @@ bashcomp_DATA = 2to3 \
rpmcheck \
rrdtool \
rsync \
+ _rtcwake \
sbcl \
sbopkg \
screen \
@@ -329,6 +336,9 @@ bashcomp_DATA = 2to3 \
sudo \
svcadm \
svk \
+ _svn \
+ _svnadmin \
+ _svnlook \
sync_members \
sysbench \
sysctl \
@@ -340,6 +350,7 @@ bashcomp_DATA = 2to3 \
tracepath \
tshark \
tune2fs \
+ _udevadm \
umount \
umount.linux \
unace \
@@ -383,20 +394,11 @@ bashcomp_DATA = 2to3 \
xz \
xzdec \
ypmatch \
+ _yum \
yum-arch \
zopfli
-EXTRA_DIST = $(bashcomp_DATA) \
- _hwclock \
- _ionice \
- _mock \
- _modules \
- _nmcli \
- _rtcwake \
- _subversion \
- _udevadm \
- _yum \
- _yum-utils
+EXTRA_DIST = $(bashcomp_DATA)
CLEANFILES = \
7za \
diff --git a/completions/_yum-utils b/completions/_repomanage
similarity index 100%
rename from completions/_yum-utils
rename to completions/_repomanage
diff --git a/completions/_subversion b/completions/_svn
similarity index 69%
rename from completions/_subversion
rename to completions/_svn
index ce61e2c..fefc5fb 100644
--- a/completions/_subversion
+++ b/completions/_svn
@@ -210,135 +210,4 @@ _svn()
} &&
complete -F _svn svn
-_svnadmin()
-{
- local cur prev words cword
- _init_completion || return
-
- local commands
- commands='create deltify dump help ? hotcopy list-dblogs list-unused-dblogs
- load lslocks lstxns recover rmlocks rmtxns setlog verify'
-
- if [[ $cword -eq 1 ]] ; then
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--version' -- "$cur" ) )
- else
- COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
- fi
- else
- case $prev in
- --config-dir)
- _filedir -d
- return 0
- ;;
- --fs-type)
- COMPREPLY=( $( compgen -W 'fsfs bdb' -- "$cur" ) )
- return 0
- ;;
- esac
-
- local command=${words[1]}
-
- if [[ "$cur" == -* ]]; then
- # possible options for the command
- local options
- case $command in
- create)
- options='--bdb-txn-nosync --bdb-log-keep --config-dir
- --fs-type'
- ;;
- deltify)
- options='--revision --quiet'
- ;;
- dump)
- options='--revision --incremental --quiet --deltas'
- ;;
- hotcopy)
- options='--clean-logs'
- ;;
- load)
- options='--ignore-uuid --force-uuid --parent-dir --quiet
- --use-pre-commit-hook --use-post-commit-hook'
- ;;
- rmtxns)
- options='--quiet'
- ;;
- setlog)
- options='--revision --bypass-hooks'
- ;;
- esac
-
- options+=" --help"
- COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
- else
- if [[ "$command" == @(help|[h?]) ]]; then
- COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
- else
- _filedir
- fi
- fi
- fi
-
- return 0
-} &&
-complete -F _svnadmin -o default svnadmin
-
-_svnlook()
-{
- local cur prev words cword
- _init_completion || return
-
- local commands
- commands='author cat changed date diff dirs-changed help ? h history info
- lock log propget pget pg proplist plist pl tree uuid youngest'
-
- if [[ $cword -eq 1 ]] ; then
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--version' -- "$cur" ) )
- else
- COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
- fi
- else
- local command=${words[1]}
-
- if [[ "$cur" == -* ]]; then
- # possible options for the command
- local options
- case $command in
- author|cat|date|dirs-changed|info|log)
- options='--revision --transaction'
- ;;
- changed)
- options='--revision --transaction --copy-info'
- ;;
- diff)
- options='--revision --transaction --no-diff-deleted
- --no-diff-added --diff-copy-from'
- ;;
- history)
- options='--revision --show-ids'
- ;;
- propget|proplist)
- options='--revision --transaction --revprop'
- ;;
- tree)
- options='--revision --transaction --show-ids --full-paths'
- ;;
- esac
-
- options+=" --help"
- COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
- else
- if [[ "$command" == @(help|[h?]) ]]; then
- COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
- else
- _filedir
- fi
- fi
- fi
-
- return 0
-} &&
-complete -F _svnlook -o default svnlook
-
# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/_svnadmin b/completions/_svnadmin
new file mode 100644
index 0000000..2fd7676
--- /dev/null
+++ b/completions/_svnadmin
@@ -0,0 +1,79 @@
+# svnadmin completion -*- shell-script -*-
+
+# Use of this file is deprecated. Upstream completion is available in
+# subversion >= 0.12.0, use that instead.
+
+_svnadmin()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local commands
+ commands='create deltify dump help ? hotcopy list-dblogs list-unused-dblogs
+ load lslocks lstxns recover rmlocks rmtxns setlog verify'
+
+ if [[ $cword -eq 1 ]] ; then
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--version' -- "$cur" ) )
+ else
+ COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
+ fi
+ else
+ case $prev in
+ --config-dir)
+ _filedir -d
+ return 0
+ ;;
+ --fs-type)
+ COMPREPLY=( $( compgen -W 'fsfs bdb' -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ local command=${words[1]}
+
+ if [[ "$cur" == -* ]]; then
+ # possible options for the command
+ local options
+ case $command in
+ create)
+ options='--bdb-txn-nosync --bdb-log-keep --config-dir
+ --fs-type'
+ ;;
+ deltify)
+ options='--revision --quiet'
+ ;;
+ dump)
+ options='--revision --incremental --quiet --deltas'
+ ;;
+ hotcopy)
+ options='--clean-logs'
+ ;;
+ load)
+ options='--ignore-uuid --force-uuid --parent-dir --quiet
+ --use-pre-commit-hook --use-post-commit-hook'
+ ;;
+ rmtxns)
+ options='--quiet'
+ ;;
+ setlog)
+ options='--revision --bypass-hooks'
+ ;;
+ esac
+
+ options+=" --help"
+ COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
+ else
+ if [[ "$command" == @(help|[h?]) ]]; then
+ COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
+ else
+ _filedir
+ fi
+ fi
+ fi
+
+ return 0
+} &&
+complete -F _svnadmin -o default svnadmin
+
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/_svnlook b/completions/_svnlook
new file mode 100644
index 0000000..0ea3659
--- /dev/null
+++ b/completions/_svnlook
@@ -0,0 +1,64 @@
+# svnlook completion -*- shell-script -*-
+
+# Use of this file is deprecated. Upstream completion is available in
+# subversion >= 0.12.0, use that instead.
+
+_svnlook()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local commands
+ commands='author cat changed date diff dirs-changed help ? h history info
+ lock log propget pget pg proplist plist pl tree uuid youngest'
+
+ if [[ $cword -eq 1 ]] ; then
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--version' -- "$cur" ) )
+ else
+ COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
+ fi
+ else
+ local command=${words[1]}
+
+ if [[ "$cur" == -* ]]; then
+ # possible options for the command
+ local options
+ case $command in
+ author|cat|date|dirs-changed|info|log)
+ options='--revision --transaction'
+ ;;
+ changed)
+ options='--revision --transaction --copy-info'
+ ;;
+ diff)
+ options='--revision --transaction --no-diff-deleted
+ --no-diff-added --diff-copy-from'
+ ;;
+ history)
+ options='--revision --show-ids'
+ ;;
+ propget|proplist)
+ options='--revision --transaction --revprop'
+ ;;
+ tree)
+ options='--revision --transaction --show-ids --full-paths'
+ ;;
+ esac
+
+ options+=" --help"
+ COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
+ else
+ if [[ "$command" == @(help|[h?]) ]]; then
+ COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
+ else
+ _filedir
+ fi
+ fi
+ fi
+
+ return 0
+} &&
+complete -F _svnlook -o default svnlook
+
+# ex: ts=4 sw=4 et filetype=sh
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git
More information about the Bash-completion-commits
mailing list