361 lines
13 KiB
Plaintext
Raw Normal View History

# Use of this file is deprecated. Upstream completion is available in
# subversion >= 0.12.0, use that instead.
# svn completion
have svn &&
{
_svn()
{
2009-10-19 21:24:25 +03:00
local cur prev commands options command
2009-10-19 21:24:25 +03:00
COMPREPLY=()
_get_comp_words_by_ref cur prev
2009-10-19 21:24:25 +03:00
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'
2009-10-19 21:24:25 +03:00
if [[ $COMP_CWORD -eq 1 ]] ; then
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--version' -- $cur ) )
else
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
fi
else
2009-10-19 21:24:25 +03:00
case $prev in
--config-dir)
_filedir -d
2010-10-23 15:18:13 +03:00
return 0
2009-10-19 21:24:25 +03:00
;;
-F|--file|--targets)
2009-10-19 21:24:25 +03:00
_filedir
2010-10-23 15:18:13 +03:00
return 0
2009-10-19 21:24:25 +03:00
;;
--encoding)
COMPREPLY=( $( compgen -W '$( iconv --list | \
sed -e "s@//@@;" )' -- "$cur" ) )
2010-10-23 15:18:13 +03:00
return 0
2009-10-19 21:24:25 +03:00
;;
--editor-cmd|--diff-cmd|--diff3-cmd)
2009-10-19 21:24:25 +03:00
COMP_WORDS=(COMP_WORDS[0] $cur)
COMP_CWORD=1
_command
2010-10-23 15:18:13 +03:00
return 0
2009-10-19 21:24:25 +03:00
;;
esac
2009-10-19 21:24:25 +03:00
command=${COMP_WORDS[1]}
2009-10-19 21:24:25 +03:00
if [[ "$cur" == -* ]]; then
# possible options for the command
case $command in
add)
2010-10-23 15:18:13 +03:00
options='--auto-props --no-auto-props --force --targets
--no-ignore --non-recursive -N -q --quiet'
2009-10-19 21:24:25 +03:00
;;
blame|annotate|ann|praise)
2010-10-23 15:18:13 +03:00
options='-r --revisions --username --password
--no-auth-cache --non-interactive -v --verbose
--incremental --xml'
2009-10-19 21:24:25 +03:00
;;
cat)
2010-10-23 15:18:13 +03:00
options='-r --revision --username --password
--no-auth-cache --non-interactive'
2009-10-19 21:24:25 +03:00
;;
checkout|co)
2010-10-23 15:18:13 +03:00
options='-r --revision -q --quiet -N --non-recursive
--username --password --no-auth-cache
--non-interactive --ignore-externals'
2009-10-19 21:24:25 +03:00
;;
cleanup)
options='--diff3-cmd'
;;
commit|ci)
2010-10-23 15:18:13 +03:00
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'
2009-10-19 21:24:25 +03:00
;;
copy|cp)
2010-10-23 15:18:13 +03:00
options='-m --message -F --file --encoding --force-log -r
--revision -q --quiet --editor-cmd -username
--password --no-auth-cache --non-interactive'
2009-10-19 21:24:25 +03:00
;;
delete|del|remove|rm)
2010-10-23 15:18:13 +03:00
options='--force -m --message -F --file --encoding
--force-log -q --quiet --targets --editor-cmd
--username --password --no-auth-cache
--non-interactive'
2009-10-19 21:24:25 +03:00
;;
diff|di)
2010-10-23 15:18:13 +03:00
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'
2009-10-19 21:24:25 +03:00
;;
export)
2010-10-23 15:18:13 +03:00
options='-r --revision -q --quiet --username --password
--no-auth-cache --non-interactive -N
--non-recursive --force --native-eol
--ignore-externals'
2009-10-19 21:24:25 +03:00
;;
import)
2010-10-23 15:18:13 +03:00
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'
2009-10-19 21:24:25 +03:00
;;
info)
2010-10-23 15:18:13 +03:00
options='--username --password --no-auth-cache
--non-interactive -r --revision --xml --targets
-R --recursive --incremental'
2009-10-19 21:24:25 +03:00
;;
list|ls)
2010-10-23 15:18:13 +03:00
options='-r --revision -v --verbose -R --recursive
--username --password --no-auth-cache
--non-interactive --incremental --xml'
2009-10-19 21:24:25 +03:00
;;
lock)
2010-10-23 15:18:13 +03:00
options='-m --message -F --file --encoding --force-log
--targets --force --username --password
--no-auth-cache --non-interactive'
2009-10-19 21:24:25 +03:00
;;
log)
2010-10-23 15:18:13 +03:00
options='-r --revision -v --verbose --targets --username
--password --no-auth-cache --non-interactive
--stop-on-copy --incremental --xml -q --quiet
--limit'
;;
2009-10-19 21:24:25 +03:00
merge)
2010-10-23 15:18:13 +03:00
options='-r --revision -N --non-recursive -q --quiet
--force --dry-run --diff3-cmd --username
--password --no-auth-cache --non-interactive
--ignore-ancestry'
2009-10-19 21:24:25 +03:00
;;
mkdir)
2010-10-23 15:18:13 +03:00
options='-m --message -F --file --encoding --force-log -q
--quiet --editor-cmd --username --password
--no-auth-cache --non-interactive'
2009-10-19 21:24:25 +03:00
;;
move|mv|rename|ren)
2010-10-23 15:18:13 +03:00
options='-m --message -F --file --encoding --force-log -r
--revision -q --quiet --force --editor-cmd
--username --password --no-auth-cache
--non-interactive'
2009-10-19 21:24:25 +03:00
;;
propdel|pdel|pd)
2010-10-23 15:18:13 +03:00
options='-q --quiet -R --recursive -r --revision --revprop
--username --password --no-auth-cache
--non-interactive'
2009-10-19 21:24:25 +03:00
;;
propedit|pedit|pe)
2010-10-23 15:18:13 +03:00
options='-r --revision --revprop --encoding --editor-cmd
--username --password --no-auth-cache
--non-interactive --force'
2009-10-19 21:24:25 +03:00
;;
propget|pget|pg)
2010-10-23 15:18:13 +03:00
options='-R --recursive -r --revision --revprop --strict
--username --password --no-auth-cache
--non-interactive'
2009-10-19 21:24:25 +03:00
;;
proplist|plist|pl)
2010-10-23 15:18:13 +03:00
options='-v --verbose -R --recursive -r --revision
--revprop -q --quiet --username --password
--no-auth-cache --non-interactive'
2009-10-19 21:24:25 +03:00
;;
propset|pset|ps)
2010-10-23 15:18:13 +03:00
options='-F --file -q --quiet --targets -R --recursive
--revprop --encoding --username --password
--no-auth-cache --non-interactive -r --revision
--force'
2009-10-19 21:24:25 +03:00
;;
resolved)
options='--targets -R --recursive -q --quiet'
;;
revert)
options='--targets -R --recursive -q --quiet'
;;
status|stat|st)
2010-10-23 15:18:13 +03:00
options='-u --show-updates -v --verbose -N --non-recursive
-q --quiet --username --password --no-auth-cache
--non-interactive --no-ignore --ignore-externals
--incremental --xml'
2009-10-19 21:24:25 +03:00
;;
switch|sw)
2010-10-23 15:18:13 +03:00
options='--relocate -r --revision -N --non-recursive -q
--quiet --username --password --no-auth-cache
--non-interactive --diff3-cmd'
2009-10-19 21:24:25 +03:00
;;
unlock)
2010-10-23 15:18:13 +03:00
options='--targets --force --username --password
--no-auth-cache --non-interactive'
2009-10-19 21:24:25 +03:00
;;
update|up)
2010-10-23 15:18:13 +03:00
options='-r --revision -N --non-recursive -q --quiet
--username --password --no-auth-cache
--non-interactive --diff3-cmd --ignore-externals'
2009-10-19 21:24:25 +03:00
;;
esac
options="$options --help -h --config-dir"
2009-10-19 21:24:25 +03:00
COMPREPLY=( $( compgen -W "$options" -- $cur ) )
else
if [[ "$command" == @(help|h|\?) ]]; then
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
else
_filedir
fi
fi
fi
2009-10-19 21:24:25 +03:00
return 0
}
complete -F _svn -o filenames svn
_svnadmin()
{
2010-10-23 15:18:13 +03:00
local cur prev commands options mode
2010-10-23 15:18:13 +03:00
COMPREPLY=()
_get_comp_words_by_ref cur prev
2010-10-23 15:18:13 +03:00
commands='create deltify dump help ? hotcopy list-dblogs list-unused-dblogs
load lslocks lstxns recover rmlocks rmtxns setlog verify'
2010-10-23 15:18:13 +03:00
if [[ $COMP_CWORD -eq 1 ]] ; then
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--version' -- $cur ) )
2009-10-19 21:24:25 +03:00
else
2010-10-23 15:18:13 +03:00
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
2010-10-23 15:18:13 +03:00
command=${COMP_WORDS[1]}
2010-10-23 15:18:13 +03:00
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
2010-10-23 15:18:13 +03:00
options="$options --help -h"
COMPREPLY=( $( compgen -W "$options" -- $cur ) )
else
if [[ "$command" == @(help|h|\?) ]]; then
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
else
_filedir
fi
2009-10-19 21:24:25 +03:00
fi
2010-10-23 15:18:13 +03:00
fi
2010-10-23 15:18:13 +03:00
return 0
}
complete -F _svnadmin -o default svnadmin
_svnlook()
{
2010-10-23 15:18:13 +03:00
local cur prev commands options mode
2010-10-23 15:18:13 +03:00
COMPREPLY=()
_get_comp_words_by_ref cur
2010-10-23 15:18:13 +03:00
commands='author cat changed date diff dirs-changed help ? h history info
lock log propget pget pg proplist plist pl tree uuid youngest'
2010-10-23 15:18:13 +03:00
if [[ $COMP_CWORD -eq 1 ]] ; then
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--version' -- $cur ) )
2009-10-19 21:24:25 +03:00
else
2010-10-23 15:18:13 +03:00
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
fi
else
command=${COMP_WORDS[1]}
2010-10-23 15:18:13 +03:00
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'
;;
propget|proplist)
options='-r --revision -t --transaction --revprop'
;;
tree)
options='-r --revision -t --transaction --show-ids
--full-paths'
;;
esac
2010-10-23 15:18:13 +03:00
options="$options --help -h"
COMPREPLY=( $( compgen -W "$options" -- $cur ) )
else
if [[ "$command" == @(help|h|\?) ]]; then
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
else
_filedir
fi
2009-10-19 21:24:25 +03:00
fi
2010-10-23 15:18:13 +03:00
fi
2010-10-23 15:18:13 +03:00
return 0
}
complete -F _svnlook -o default svnlook
}
# Local variables:
# mode: shell-script
2009-10-04 19:42:50 +02:00
# sh-basic-offset: 4
# sh-indent-comment: t
2009-10-04 19:42:50 +02:00
# indent-tabs-mode: nil
# End:
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh