Added new subversion completion implementation by Guillaume Rousse
<guillomovitch@zarb.org> and removed the old one from contrib.
This commit is contained in:
parent
c9911c5860
commit
7560a45355
426
bash_completion
426
bash_completion
@ -1,7 +1,7 @@
|
||||
# bash_completion - programmable completion functions for bash 3.x
|
||||
# (backwards compatible with bash 2.05b)
|
||||
#
|
||||
# $Id: bash_completion,v 1.869 2006/03/01 10:13:27 ianmacd Exp $
|
||||
# $Id: bash_completion,v 1.870 2006/03/01 10:22:43 ianmacd Exp $
|
||||
#
|
||||
# Copyright (C) Ian Macdonald <ian@caliban.org>
|
||||
#
|
||||
@ -8808,6 +8808,430 @@ _minicom()
|
||||
} &&
|
||||
complete -F _minicom minicom
|
||||
|
||||
# svn completion
|
||||
#
|
||||
have svn &&
|
||||
{
|
||||
_svn()
|
||||
{
|
||||
local cur prev commands options command
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
|
||||
commands='add blame praise annotate ann cat checkout co cleanup commit \
|
||||
ci copy cp delete del remove rm diff di export help ? h import \
|
||||
info list ls lock log merge mkdir move mv rename ren \
|
||||
propdel pdel pd propedit pedit pe propget pget pg \
|
||||
proplist plist pl propset pset ps resolved revert \
|
||||
status stat st switch sw unlock update up'
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 ]] ; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--version' -- $cur ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
|
||||
fi
|
||||
else
|
||||
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
case $prev in
|
||||
--config-dir)
|
||||
_filedir -d
|
||||
return 0;
|
||||
;;
|
||||
-@(F|-file|-targets))
|
||||
_filedir
|
||||
return 0;
|
||||
;;
|
||||
--encoding)
|
||||
COMPREPLY=( $( compgen -W \
|
||||
'$( iconv --list | sed -e "s@//@@;" )' \
|
||||
-- "$cur" ) )
|
||||
return 0;
|
||||
;;
|
||||
--@(editor|diff|diff3)-cmd)
|
||||
COMP_WORDS=(COMP_WORDS[0] $cur)
|
||||
COMP_CWORD=1
|
||||
_command
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
command=${COMP_WORDS[1]}
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# possible options for the command
|
||||
case $command in
|
||||
add)
|
||||
options='--auto-props --no-auto-props \
|
||||
--force --targets --no-ignore \
|
||||
--non-recursive -N -q --quiet'
|
||||
;;
|
||||
@(blame|annotate|ann|praise))
|
||||
options='-r --revisions --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive -v \
|
||||
--verbose --incremental --xml'
|
||||
;;
|
||||
cat)
|
||||
options='-r --revision --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(checkout|co))
|
||||
options='-r --revision -q --quiet -N \
|
||||
--non-recursive --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive \
|
||||
--ignore-externals'
|
||||
;;
|
||||
cleanup)
|
||||
options='--diff3-cmd'
|
||||
;;
|
||||
@(commit|ci))
|
||||
options='-m --message -F --file \
|
||||
--encoding --force-log -q \
|
||||
--quiet --non-recursive -N \
|
||||
--targets --editor-cmd \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive --no-unlock'
|
||||
;;
|
||||
@(copy|cp))
|
||||
options='-m --message -F --file \
|
||||
--encoding --force-log -r \
|
||||
--revision -q --quiet \
|
||||
--editor-cmd -username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(delete|del|remove|rm))
|
||||
options='--force -m --message -F \
|
||||
--file --encoding --force-log \
|
||||
-q --quiet --targets \
|
||||
--editor-cmd -username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(diff|di))
|
||||
options='-r --revision -x --extensions \
|
||||
--diff-cmd --no-diff-deleted \
|
||||
-N --non-recursive --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive --force \
|
||||
--old --new --notice-ancestry'
|
||||
;;
|
||||
export)
|
||||
options='-r --revision -q --quiet \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive -N \
|
||||
--non-recursive --force \
|
||||
--native-eol --ignore-externals'
|
||||
;;
|
||||
import)
|
||||
options='--auto-props --no-auto-props \
|
||||
-m --message -F --file \
|
||||
--encoding --force-log -q \
|
||||
--quiet --non-recursive \
|
||||
--no-ignore --editor-cmd \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
info)
|
||||
options='--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive -r \
|
||||
--revision --xml --targets \
|
||||
-R --recursive --incremental'
|
||||
;;
|
||||
@(list|ls))
|
||||
options='-r --revision -v --verbose -R \
|
||||
--recursive --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive \
|
||||
--incremental --xml'
|
||||
;;
|
||||
lock)
|
||||
options='-m --message -F --file \
|
||||
--encoding --force-log \
|
||||
--targets --force --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
log)
|
||||
options='-r --revision -v --verbose \
|
||||
--targets --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive \
|
||||
--stop-on-copy --incremental \
|
||||
--xml -q --quiet --limit'
|
||||
;;
|
||||
merge)
|
||||
options='-r --revision -N \
|
||||
--non-recursive -q --quiet \
|
||||
--force --dry-run --diff3-cmd \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive \
|
||||
--ignore-ancestry'
|
||||
;;
|
||||
mkdir)
|
||||
options='-m --message -F --file \
|
||||
--encoding --force-log -q \
|
||||
--quiet --editor-cmd \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(move|mv|rename|ren))
|
||||
options='-m --message -F --file \
|
||||
--encoding --force-log -r \
|
||||
--revision -q --quiet \
|
||||
--force --editor-cmd \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(propdel|pdel|pd))
|
||||
options='-q --quiet -R --recursive -r \
|
||||
--revision --revprop \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(propedit|pedit|pe))
|
||||
options='-r --revision --revprop \
|
||||
--encoding --editor-cmd \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive --force'
|
||||
;;
|
||||
@(propget|pget|pg))
|
||||
options='-R --recursive -r --revision \
|
||||
--revprop --strict --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(proplist|plist|pl))
|
||||
options='-v --verbose -R --recursive \
|
||||
-r --revision --revprop -q \
|
||||
--quiet --username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(propset|pset|ps))
|
||||
options='-F --file -q --quiet \
|
||||
--targets -R --recursive \
|
||||
--revprop --encoding \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive -r \
|
||||
--revision --force'
|
||||
;;
|
||||
resolved)
|
||||
options='--targets -R --recursive -q \
|
||||
--quiet'
|
||||
;;
|
||||
revert)
|
||||
options='--targets -R --recursive -q \
|
||||
--quiet'
|
||||
;;
|
||||
@(status|stat|st))
|
||||
options='-u --show-updates -v \
|
||||
--verbose -N --non-recursive \
|
||||
-q --quiet --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive --no-ignore \
|
||||
--ignore-externals \
|
||||
--incremental --xml'
|
||||
;;
|
||||
@(switch|sw))
|
||||
options='--relocate -r --revision -N \
|
||||
--non-recursive -q --quiet \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive --diff3-cmd'
|
||||
;;
|
||||
unlock)
|
||||
options='--targets --force --username \
|
||||
--password --no-auth-cache \
|
||||
--non-interactive'
|
||||
;;
|
||||
@(update|up))
|
||||
options='-r --revision -N \
|
||||
--non-recursive -q --quiet \
|
||||
--username --password \
|
||||
--no-auth-cache \
|
||||
--non-interactive \
|
||||
--diff3-cmd --ignore-externals'
|
||||
;;
|
||||
esac
|
||||
options="$options --help -h --config-dir"
|
||||
|
||||
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 _svn $default svn
|
||||
|
||||
_svnadmin()
|
||||
{
|
||||
local cur prev commands options mode
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
|
||||
commands='create deltify dump help ? hotcopy list-dblogs \
|
||||
list-unused-dblogs load lslocks lstxns recover rmlocks \
|
||||
rmtxns setlog verify'
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 ]] ; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--version' -- $cur ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
|
||||
fi
|
||||
else
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
case $prev in
|
||||
--config-dir)
|
||||
_filedir -d
|
||||
return 0;
|
||||
;;
|
||||
--fs-type)
|
||||
COMPREPLY=( $( compgen -W 'fsfs bdb' -- $cur ) )
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
command=${COMP_WORDS[1]}
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# possible options for the command
|
||||
case $command in
|
||||
create)
|
||||
options='--bdb-txn-nosync \
|
||||
--bdb-log-keep --config-dir \
|
||||
--fs-type'
|
||||
;;
|
||||
deltify)
|
||||
options='-r --revision -q --quiet'
|
||||
;;
|
||||
dump)
|
||||
options='-r --revision --incremental \
|
||||
-q --quiet --deltas'
|
||||
;;
|
||||
hotcopy)
|
||||
options='--clean-logs'
|
||||
;;
|
||||
load)
|
||||
options='--ignore-uuid --force-uuid \
|
||||
--parent-dir -q --quiet \
|
||||
--use-pre-commit-hook \
|
||||
--use-post-commit-hook'
|
||||
;;
|
||||
rmtxns)
|
||||
options='-q --quiet'
|
||||
;;
|
||||
setlog)
|
||||
options='-r --revision --bypass-hooks'
|
||||
;;
|
||||
esac
|
||||
|
||||
options="$options --help -h"
|
||||
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 $default svnadmin
|
||||
|
||||
_svnlook()
|
||||
{
|
||||
local cur prev commands options mode
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
|
||||
commands='author cat changed date diff dirs-changed help ? h history \
|
||||
info lock log propget pget pg proplist plist pl tree uuid \
|
||||
youngest'
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 ]] ; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--version' -- $cur ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
|
||||
fi
|
||||
else
|
||||
command=${COMP_WORDS[1]}
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# possible options for the command
|
||||
case $command in
|
||||
@(author|cat|date|dirs-changed|info|log))
|
||||
options='-r --revision -t \
|
||||
--transaction'
|
||||
;;
|
||||
changed)
|
||||
options='-r --revision -t \
|
||||
--transaction --copy-info'
|
||||
;;
|
||||
diff)
|
||||
options='-r --revision -t \
|
||||
--transaction \
|
||||
--no-diff-deleted \
|
||||
--no-diff-added \
|
||||
--diff-copy-from'
|
||||
;;
|
||||
history)
|
||||
options='-r --revision --show-ids'
|
||||
;;
|
||||
prop@(get|list))
|
||||
options='-r --revision -t \
|
||||
--transaction --revprop'
|
||||
;;
|
||||
tree)
|
||||
options='-r --revision -t \
|
||||
--transaction --show-ids \
|
||||
--full-paths'
|
||||
;;
|
||||
esac
|
||||
|
||||
options="$options --help -h"
|
||||
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 $default svnlook
|
||||
}
|
||||
|
||||
_filedir_xspec()
|
||||
{
|
||||
local IFS cur xspec
|
||||
|
@ -1,21 +0,0 @@
|
||||
# subversion completion by Jean-Baptiste Quenot <jb.quenot@caraldi.com>
|
||||
#
|
||||
# $Id: subversion,v 1.1 2004/03/30 23:12:00 ianmacd Exp $
|
||||
|
||||
_svn()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
|
||||
[ $COMP_CWORD = 1 ] && \
|
||||
COMPREPLY=( $( compgen -W 'add cat checkout cleanup commit copy \
|
||||
delete diff export help import info list \
|
||||
log merge mkdir move propdel propedit \
|
||||
propget proplist propset resolved revert \
|
||||
status switch update' -- $cur ) )
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -F _svn -o default svn
|
Loading…
x
Reference in New Issue
Block a user