Index: CMT/HEAD/ChangeLog
===================================================================
--- CMT/HEAD/ChangeLog	(revision 582)
+++ CMT/HEAD/ChangeLog	(revision 583)
@@ -1,2 +1,9 @@
+2011-06-22    <rybkin@lal.in2p3.fr> 461
+
+	* src/setup.tcsh: Improve/fix word completions for tcsh
+	* src/setup.zsh: Improve/fix word completions for zsh
+	* src/setup.csh: Ensure tcsh is always identified and word completions are
+	defined
+	
 2011-06-09    <rybkin@lal.in2p3.fr> 460
 
Index: CMT/HEAD/src/setup.csh
===================================================================
--- CMT/HEAD/src/setup.csh	(revision 582)
+++ CMT/HEAD/src/setup.csh	(revision 583)
@@ -11,5 +11,5 @@
 endif
 
-if ( `basename "$SHELL"` == "tcsh" ) then
+if ( $?tcsh == 1 || `basename "$shell"` == "tcsh" ) then
   source ${CMTROOT}/src/setup.tcsh
 endif
Index: CMT/HEAD/src/setup.tcsh
===================================================================
--- CMT/HEAD/src/setup.tcsh	(revision 582)
+++ CMT/HEAD/src/setup.tcsh	(revision 583)
@@ -6,15 +6,17 @@
 #-----------------------------------------------------------
 
-complete cmt p/1/'(broadcast build check check_files checkout co cleanup config create expand filter help lock relocate remove run setup show system unlock version cvstags cvsbranches cvssubpackages cvssubprojects)'/ \
+complete cmt p/1/'(broadcast build check check_files checkout co cleanup config create create_project expand filter help lock relocate remove run setup show system unlock version cvstags cvsbranches cvssubpackages cvssubprojects)'/ \
+ n/broadcast/'(-begin= -select= -exclude= -local -global -depth=)'/ \
+ n/'-{begin=,select=,exclude=,local,global,depth=}'/c/ \
+ n/br/c/ \
  n/build/'(CMT_pacman constituent_makefile constituents_makefile dependencies library_links make_setup msdev os9_makefile prototype readme tag_makefile temporary_name triggers win_makefile)'/ \
+ n/check_files/f/ \
+ n/expand/'(model)'/ \
  n/show/'(action action_names action_value actions all_tags applied_patterns author branches clients cmtpath_patterns constituent constituent_names constituents container cycles fragment fragments groups include_dirs language languages macro macro_names macro_value macros manager packages path pattern patterns projects project_author pwd set set_names set_value sets strategies tags use_paths uses versions)'/ \
- n/check/'(configuration files version)'/ \
- n/expand/'(model)'/ \
+ n/constituents_makefile/n/ \
  n/constituent/'`cmt -quiet show constituent_names`'/ \
  n/fragment/'`cmt -quiet show fragments | sed -e "s#.*fragments.##" `'/ \
  n/action/'`cmt -quiet show action_names | sed -e "s#=.*##" `'/ \
  n/action_value/'`cmt -quiet show action_names | sed -e "s#=.*##" `'/ \
- n/build/'(CMT_pacman constituent_makefile constituents_makefile dependencies library_links make_setup msdev os9_makefile prototype readme tag_makefile temporary_name triggers win_makefile)'/ \
- n/broadcast/'(-begin= -select= -exclude= -local -global -depth=)'/ \
  n/macro/'`cmt -quiet show macro_names | sed -e "s#=.*##" `'/ \
  n/macro_value/'`cmt -quiet show macro_names | sed -e "s#=.*##" `'/ \
@@ -23,4 +25,4 @@
  n/set_value/'`cmt -quiet show set_names | sed -e "s#=.*##" `'/ \
  n/triggers/'`cmt -quiet show constituent_names`'/ \
- n/co/'(-l,-R,-r,-d,-o,-requirements)'/ \
- n/checkout/'(-l,-R,-r,-d,-o,-requirements)'/
+ 'n/c{o,heckout}/(-l -R -r -C -i -vd -d -o -requirements -no_config -rs --help)/' \
+ n/check/'(configuration files version)'/
Index: CMT/HEAD/src/setup.zsh
===================================================================
--- CMT/HEAD/src/setup.zsh	(revision 582)
+++ CMT/HEAD/src/setup.zsh	(revision 583)
@@ -13,14 +13,16 @@
    function cmt_default_path { d=`dirname ${CMTROOT}`; reply=(`dirname ${d}`) }; \
    function cmt_patterns { reply=(`cmt -quiet show pattern_names`) }; \
-   compctl -k '(broadcast,build,check,check_files,checkout,co,cleanup,config,create,create_project,expand,filter,help,lock,relocate,remove,run,setup,show,system,unlock,version,cvstags,cvsbranches,cvssubpackages,cvssubprojects)' -x \
-   'c[-1,broadcast]' -k '(-begin=,-select=,-exclude=,-local,-global,-depth=)' - \
+   compctl -x 'p[1]' -k '(broadcast,build,check,check_files,checkout,co,cleanup,config,create,create_project,expand,filter,help,lock,relocate,remove,run,setup,show,system,unlock,version,cvstags,cvsbranches,cvssubpackages,cvssubprojects)' - \
+   'w[1,broadcast] S[-]' -k '(-begin=,-select=,-exclude=,-local,-global,-depth=)' - \
+   'w[1,broadcast]' -c - \
    's[build],c[-1,build]' -k '(CMT_pacman, constituent_makefile,constituents_makefile,dependencies,library_links,make_setup,msdev,os9_makefile,prototype,readme,tag_makefile,temporary_name,triggers,win_makefile)' - \
    'w[1,build] c[-1,constituent_makefile]' -K cmt_constituents - \
    'w[1,build] c[-1,triggers]' -K cmt_constituents - \
    'c[-1,check]' -k '(configuration,files,version)' - \
+   'C[-1,*files],C[-2,*files]' -f - \
    'w[1,create] p[2]' -X '> give package name' - \
    'w[1,create] p[3]' -X '> give version tag' - \
    'w[1,create] p[4]' -X '> give a path if not created from current path' - \
-   's[expand],c[-1,expand]' -k '(model)' - \
+   'c[-1,expand]' -k '(model)' - \
    'w[1,remove] p[2]' -X '> library_links or give package name' - \
    'w[1,remove] p[3]' -X '> give version tag' - \
@@ -36,13 +38,9 @@
    'w[1,show] c[-1,set]' -K cmt_sets - \
    'w[1,show] c[-1,set_value]' -K cmt_sets - \
-   'c[-1,co]' -k '(-l,-R,-r,-d,-o,-requirements)' - \
-   'c[-1,checkout]' -k '(-l,-R,-r,-d,-o,-requirements)' - \
+   'w[1,co] s[-],w[1,checkout] s[-]' -k '(l R r C i vd d o requirements no_config rs -help)' - \
    'c[-1,-r]' -X 'give a CVS tag' - \
-   'c[-1,-d]' -X 'give a directory name' - \
+   'C[-1,(-vd|-d)]' -/ -X 'give a directory name' - \
    'c[-1,-o]' -X 'give an offset in the CVS repository' - \
    'c[-1,-requirements]' -f - \
-   'c[-1,co]' -X 'give package name' \
+   'c[-1,co],c[-1,checkout]' -X 'give package name' - \
    --  cmt.exe
-
-
-
