# svnlook completion -*- shell-script -*- # Use of this file is deprecated. Upstream completion is available in # subversion >= 0.12.0, use that instead. proc _svnlook { var cur = '', prev = '', words = '', cword = '' _init_completion || return var commands = '' set 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 ]] { if [[ "$cur" == -* ]] { setglobal COMPREPLY = '( '$( compgen -W '--version' -- "$cur" ) ) } else { setglobal COMPREPLY = '( '$( compgen -W "$commands" -- "$cur" ) ) } } else { var command = $(words[1]) if [[ "$cur" == -* ]] { # possible options for the command var options = '' match $command { with author|cat|date|dirs-changed|info|log set options = ''--revision --transaction'' with changed set options = ''--revision --transaction --copy-info'' with diff set options = ''--revision --transaction --no-diff-deleted --no-diff-added --diff-copy-from'' with history set options = ''--revision --show-ids'' with propget|proplist set options = ''--revision --transaction --revprop'' with tree set options = ''--revision --transaction --show-ids --full-paths'' } set options = '" --help'" setglobal COMPREPLY = '( '$( compgen -W "$options" -- "$cur" ) ) } else { if [[ "$command" == @(help|[h?]) ]] { setglobal COMPREPLY = '( '$( compgen -W "$commands" -- "$cur" ) ) } else { _filedir } } } return 0 } && complete -F _svnlook -o default svnlook # ex: ts=4 sw=4 et filetype=sh