From 21c61a550e5ae2a1ec39f030eff413125b39f7fe Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Sun, 2 Jan 2005 23:48:27 +0000 Subject: [PATCH] - Add ,v files to list rcs(1) can complete on. From Ed Catmur via Aaron Walker . --- bash_completion | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bash_completion b/bash_completion index c20f16dd..efb1b832 100644 --- a/bash_completion +++ b/bash_completion @@ -1,6 +1,6 @@ # bash_completion - some programmable completion functions for bash 2.05b # -# $Id: bash_completion,v 1.761 2004/11/22 21:20:43 ianmacd Exp $ +# $Id: bash_completion,v 1.762 2005/01/03 00:48:27 ianmacd Exp $ # # Copyright (C) Ian Macdonald # @@ -4392,7 +4392,7 @@ complete -F _perldoc $default perldoc have rcs && _rcs() { - local cur prev file dir + local cur prev file dir i COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} @@ -4408,10 +4408,15 @@ _rcs() for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do file=${COMPREPLY[$i]##*/} - file=${file%,v} dir=${COMPREPLY[$i]%RCS/*} COMPREPLY[$i]=$dir$file done + + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -G "$dir/$file*,v" ) ) + + for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do + COMPREPLY[$i]=${COMPREPLY[$i]%,v} + done # default to files if nothing returned and we're checking in. # otherwise, default to directories