# svnlook completion -*- shell-script -*- # Use of this file is deprecated. Upstream completion is available in # subversion >= 0.12.0, use that instead. proc _svnlook { local cur prev words cword _init_completion || return local commands setglobal 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 { local command=$(words[1]) if [[ "$cur" == -* ]] { # possible options for the command local options match $command { with author|cat|date|dirs-changed|info|log setglobal options = ''--revision --transaction'' with changed setglobal options = ''--revision --transaction --copy-info'' with diff setglobal options = ''--revision --transaction --no-diff-deleted --no-diff-added --diff-copy-from'' with history setglobal options = ''--revision --show-ids'' with propget|proplist setglobal options = ''--revision --transaction --revprop'' with tree setglobal options = ''--revision --transaction --show-ids --full-paths'' } setglobal 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