Fix malformed CUDA version macro check
[alexxy/gromacs.git] / admin / mkcompl
1 #!/bin/csh -f
2
3 # NB: Put the finished completions in the gromacs-x.y.z/scripts directory.
4
5 if ( $#argv < 1 ) then
6   echo "Error: provide the binary directory as first argument."
7   echo "Completions will be written in the current directory."
8   exit
9 endif
10
11 set GMXBINDIR = $1
12
13 set out = completion
14 set dir = $cwd
15
16 echo Generating completions for csh, bash and zsh
17
18 if ( -f $out.csh) then
19   rm $out.csh 
20 endif
21 if ( -f $out.bash) then
22   rm $out.bash 
23 endif
24 if ( -f $out.zsh) then
25   rm $out.zsh 
26 endif
27
28 touch $out.csh $out.bash $out.zsh
29
30 cd $GMXBINDIR
31 set PROGRAMS = [a-z]*
32 cd $dir
33
34 foreach program ( $PROGRAMS )
35   if ( ( -x $GMXBINDIR/$program ) && ( $program != "my_dssp" )  && ( $program != "average" ) && ( $program != "GMXRC" ) && ( $program != "completion.zsh" ) && ( $program != "completion.csh" )  && ( $program != "completion.bash" ) && ( $program != "luck" ) ) then
36     $GMXBINDIR/$program -man completion >& /dev/null
37     cat $program.completion-csh >> $out.csh
38     cat $program.completion-bash >> $out.bash
39     cat $program.completion-zsh >> $out.zsh
40     \rm $program.completion-csh $program.completion-bash $program.completion-zsh 
41   endif
42 end
43
44 #last line
45