On my previous post:
: I'm having a bit of trouble to get complete in tcsh to do what I want:
: complete cd 'p/1/d:^CVS/'
: I want this to mean "complete cd with directorys but skip those named CVS".
: It doesn't work though, could anyone shed som light on this?
Completion of directories (under tcsh) is problematic.
Directories are treated as a part of a path to a file, this makes sense only
when the target is a regular file, not a directory!
my solution was:
complete cd 'p/1/`get_dirs_except_CVS`/'
Well this does not work very well. I didn't like this fact, so I made a patch
on the old tcsh (6.04.00).
After applying the patch your `complete' statement should work for you.
NOTE: No warranty on the patch, I am not one of he writers of tcsh, so
I can be missing something in my patch, please test it with care!
the patch:
------------ cut here -----------------------------
*** ../tcsh-6.04/tw.parse.c Thu Jul 8 08:52:58 1993
--- tw.parse.c Tue Apr 26 22:58:45 1994
***************
*** 844,850 ****
if (text_check && isadirectory(exp_dir, item))
break;
! if (gpat && !Gmatch(item, pat) && !isadirectory(exp_dir, item))
break;
/*
--- 844,851 ----
if (text_check && isadirectory(exp_dir, item))
break;
! if (gpat && !Gmatch(item, pat) && (
! TW_DIRECTORY == looking || !isadirectory(exp_dir, item)))
break;
/*