# HG changeset patch # User Oleksandr Gavenko # Date 1319568764 -10800 # Node ID 8469af3b5d40000a2c06b269f346f013d0996bb0 # Parent 3c0d218db7a355c402528f44926df80307c150c2 Add completion for 'pathsearch'. diff -r 3c0d218db7a3 -r 8469af3b5d40 .bashrc --- a/.bashrc Tue Oct 25 18:04:59 2011 +0300 +++ b/.bashrc Tue Oct 25 21:52:44 2011 +0300 @@ -209,3 +209,18 @@ } complete -F _hgsyncew -o nospace hgsyncew +_pathsearch() { + local prev cur=${COMP_WORDS[$COMP_CWORD]} + [[ $COMP_CWORD > 0 ]] && prev=${COMP_WORDS[(($COMP_CWORD-1))]} + if [[ $prev = -d ]]; then + COMPREPLY=() + return 0 + fi + case "$cur" in + -*) COMPREPLY=( $(compgen -W "-d --delimiter= -h --help" -- $cur ) ) ;; + *) COMPREPLY=() ;; + esac + return 0 +} +complete -F _pathsearch -o nospace pathsearch +