# svn completion -*- shell-script -*- # Use of this file is deprecated. Upstream completion is available in # subversion >= 0.12.0, use that instead. _svn() { local cur prev words cword _init_completion || return local commands 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 [[ $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 ;; -F|--file|--targets) _filedir return 0 ;; --encoding) COMPREPLY=( $( compgen -W '$( iconv --list | \ sed -e "s@//@@;" )' -- "$cur" ) ) return 0 ;; --editor-cmd|--diff-cmd|--diff3-cmd) words=(words[0] $cur) cword=1 _command return 0 ;; esac local command=${words[1]} if [[ "$cur" == -* ]]; then # possible options for the command local options case $command in add) options='--auto-props --no-auto-props --force --targets --no-ignore --non-recursive --quiet' ;; blame|annotate|ann|praise) options='--revision --username --password --no-auth-cache --non-interactive --verbose --incremental --xml' ;; cat) options='--revision --username --password --no-auth-cache --non-interactive' ;; checkout|co) options='--revision --quiet --non-recursive --username --password --no-auth-cache --non-interactive --ignore-externals' ;; cleanup) options='--diff3-cmd' ;; commit|ci) options='--message --file --encoding --force-log --quiet --non-recursive --targets --editor-cmd --username --password --no-auth-cache --non-interactive --no-unlock' ;; copy|cp) options='--message --file --encoding --force-log --revision --quiet --editor-cmd -username --password --no-auth-cache --non-interactive' ;; delete|del|remove|rm) options='--force --message --file --encoding --force-log --quiet --targets --editor-cmd --username --password --no-auth-cache --non-interactive' ;; diff|di) options='--revision --extensions --diff-cmd --no-diff-deleted --non-recursive --username --password --no-auth-cache --non-interactive --force --old --new --notice-ancestry' ;; export) options='--revision --quiet --username --password --no-auth-cache --non-interactive --non-recursive --force --native-eol --ignore-externals' ;; import) options='--auto-props --no-auto-props --message --file --encoding --force-log --quiet --non-recursive --no-ignore --editor-cmd --username --password --no-auth-cache --non-interactive' ;; info) options='--username --password --no-auth-cache --non-interactive --revision --xml --targets --recursive --incremental' ;; list|ls) options='--revision --verbose --recursive --username --password --no-auth-cache --non-interactive --incremental --xml' ;; lock) options='--message --file --encoding --force-log --targets --force --username --password --no-auth-cache --non-interactive' ;; log) options='--revision --verbose --targets --username --password --no-auth-cache --non-interactive --stop-on-copy --incremental --xml --quiet --limit' ;; merge) options='--revision --non-recursive --quiet --force --dry-run --diff3-cmd --username --password --no-auth-cache --non-interactive --ignore-ancestry' ;; mkdir) options='--message --file --encoding --force-log --quiet --editor-cmd --username --password --no-auth-cache --non-interactive' ;; move|mv|rename|ren) options='--message --file --encoding --force-log --revision --quiet --force --editor-cmd --username --password --no-auth-cache --non-interactive' ;; propdel|pdel|pd) options='--quiet --recursive --revision --revprop --username --password --no-auth-cache --non-interactive' ;; propedit|pedit|pe) options='--revision --revprop --encoding --editor-cmd --username --password --no-auth-cache --non-interactive --force' ;; propget|pget|pg) options='--recursive --revision --revprop --strict --username --password --no-auth-cache --non-interactive' ;; proplist|plist|pl) options='--verbose --recursive --revision --revprop --quiet --username --password --no-auth-cache --non-interactive' ;; propset|pset|ps) options='--file --quiet --targets --recursive --revprop --encoding --username --password --no-auth-cache --non-interactive --revision --force' ;; resolved) options='--targets --recursive --quiet' ;; revert) options='--targets --recursive --quiet' ;; status|stat|st) options='--show-updates --verbose --non-recursive --quiet --username --password --no-auth-cache --non-interactive --no-ignore --ignore-externals --incremental --xml' ;; switch|sw) options='--relocate --revision --non-recursive --quiet --username --password --no-auth-cache --non-interactive --diff3-cmd' ;; unlock) options='--targets --force --username --password --no-auth-cache --non-interactive' ;; update|up) options='--revision --non-recursive --quiet --username --password --no-auth-cache --non-interactive --diff3-cmd --ignore-externals' ;; esac options+=" --help --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 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