-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathirods_completion.tcsh
24 lines (21 loc) · 1.09 KB
/
irods_completion.tcsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/tcsh
################################################################################
## iRODS tcsh completion for standard icommands and associated scripts
## Originally written by Syam Gadde for SRB.
## Adapted for the csh and tcsh shells by Jean-Yves Nief 29/03/10.
##
## To enable your tcsh shell to support iRODS <tab> completion for icommands
## simply source this file in your shell as follows:
##
## source irods_completion.tcsh
##
## You can add the above line to your .tcshrc or .cshrc file to enable iRODS
## <tab> completion for all of your tcsh logins.
##
################################################################################
## list commands which should use iRODS lookups for completions
set command_list="ibun icd ichksum ichmod icp iget ils imeta imkdir imv iphybun iphymv iput irm irmtrash irsync itrim"
## Enable ALL listed commands to use iRODS completion
foreach command ($command_list)
complete $command 'c%*/%`set q=$:-0; echo $q | perl -pe '"'"'s|^/[^/]+$|/|; s|(.)/[^/]*$|\1|;'"'"' | xargs ils | perl -ne "/^ / || next; s|^ \([^C]\)|\1|; s|^ C-.*/||; print;"`%%'
end