"complete" command in tcsh

"complete" command in tcsh

Post by Ake Beckm » Sat, 23 Apr 1994 20:08:23



Hello!

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?

Any help appreciated!

version tcsh 6.04.00 (Cornell) 93/07/03 (sun4) options 8b,nls,dl,al

Ake Beckman

        UNIX Systems Support
        Ellemtel Telecommunications Systems Laboratories
        S-125 25 STOCKHOLM Sweden
        Phone   : +46 8 727 3782  Fax  : +46 8 647 82 76

 
 
 

"complete" command in tcsh

Post by Michael Veksl » Thu, 28 Apr 1994 00:14:03


: Hello!

: 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,
for example `CVS/doc' is a legal completion (as long it is a directory),
sometimes this behavior is unwanted, but this is what you got...
I think you can do your staff by:

complete cd 'p/1/`get_dirs_except_CVS`
when get_dirs_except_CVS is:
  o  a script/binary that prints all the directories except CVS
  o  complete cd 'n/*/`ls -l | grep ^d | awk '\''$9 != "CVS" {print $9}'\''`/'
     it is pretty slow (1 sec) on my highly loaded machine (load average 4)

 
 
 

"complete" command in tcsh

Post by Michael Veksl » Thu, 28 Apr 1994 16:52:36


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;

            /*

 
 
 

"complete" command in tcsh

Post by Christos Zoul » Fri, 29 Apr 1994 10:54:58




>: Hello!

>: 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,
>for example `CVS/doc' is a legal completion (as long it is a directory),
>sometimes this behavior is unwanted, but this is what you got...
>I think you can do your staff by:

This is fixed in tcsh-6.05 coming soon to an ftp site near you...

christos

 
 
 

1. Tcsh builtin command "complete"

Does anyone know how to use the builtin command "complete" for tcsh. Is
there any detailed information on the syntax for the command?

I am trying to write a "complete" which has three arguments for the
command in question, the second argument is dependant on the first, and
the third is dependant on both the first and second. How do I reference
the chosen completions for the previous arguments?

My current attempt which obviously doesn't work is:
complete my_cmd 'p/1/`cmd_args`/' \
               'p/2/`cmd_args FIRST_ARGUMENT`/' \
               'p/3/`cmd_args FIRST_ARG SECOND_ARG`/'

I need to know what to replace the "FIRST_ARG" and "SECOND_ARG" with?

2. Cisco IP NGN Enables End-to-End Digital Video and IPTV Service Delivery for 'Video 2.0

3. GETSERVBYNAME()????????????????????"""""""""""""

4. Is the Brother HL-1440 supported on Linux?

5. "write" "to" "flon" commands

6. Warning on Sun/C++

7. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

8. Term & minicom

9. "weof" operation in "mt" command gives "permission denied"

10. ". / command" instead of "command" ???

11. HELP: "TOP" Command and "SZ" command

12. tcsh question: "complete" rejects long arg list

13. Installs "Complete" when "Standard" selected