1 #Write all help of syd tools in a file sydTool.md
2 #Execute it in src folder but the tools have to be into ../bin/bin (or change it)
3 #Results are in src folder
8 #Copy all help into a temporary file
11 clitkTools=`ls clitk*`
12 echo "This page contains additional information on how to use clitk tools:" > $tempFile
14 for tool in $clitkTools
16 echo "==== " $tool " ====" >> $tempFile
25 docFile="$currentFolder/clitkTool.txt"
27 helpLine=false #Boolean to know if we are reading the command lines starting with '-h, --help' and finishing with '##' or just the help
30 while IFS='' read -r line || [[ -n "$line" ]]; do #read all lines
32 line=`echo "$line" | sed -e 's/^[ \t]*//'`; # prevent whitespace at the begining of the line
33 if [[ $line == *"-h, --help"* ]]; then
36 if [[ $line == *"===="* ]]; then
38 echo "$echoLine||" >> $docFile;
50 if [[ $line == "" ]]; then
53 #Create the string according to the different case of ggo
58 if [[ $line == "-"[a-zA-Z]* ]]; then
60 echoLine="$echoLine||";
61 echo "$echoLine" >> $docFile;
65 tempString=`echo "$line" | cut -c1-2`; # eg take the -h
66 echoLine="$echoLine$tempString";
67 line=`echo "$line" | cut -d' ' -f2-`; # remove -h, (first word)
68 line=`echo "$line" | sed -e 's/^[ \t]*//'`; # prevent whitespace at the begining of the line
69 echoLine="$echoLine||";
70 tempString=`echo "$line" | cut -f 1 -d " "`; # eg take the --help (first word)
71 echoLine="$echoLine$tempString";
72 line=`echo "$line" | cut -d' ' -f2-`; # remove --help (first word)
73 line=`echo "$line" | sed -e 's/^[ \t]*//'`; # prevent whitespace at the begining of the line
74 echoLine="$echoLine||$line";
75 elif [[ $line == "--"* ]]; then
77 echoLine="$echoLine||";
78 echo "$echoLine" >> $docFile;
82 tempString=`echo "$line" | cut -f 1 -d " "`; # eg take the --help (first word)
83 echoLine="$echoLine$tempString";
84 line=`echo "$line" | cut -d' ' -f2-`; # remove --help (first word)
85 line=`echo "$line" | sed -e 's/^[ \t]*//'`; # prevent whitespace at the begining of the line
86 echoLine="$echoLine||$line";
87 elif [[ $copyLine == " "* ]]; then
88 echoLine="$echoLine$line";
91 echoLine="$echoLine||";
92 echo "$echoLine" >> $docFile;
94 echoLine="||||||<style=\"" & quot;text-align:center& quot; "\">$line||";
95 echo "$echoLine" >> $docFile;
100 if [[ `echo "$line" | cut -c1-1` = "-" ]]; then
101 echo " " >> $docFile;
102 echo "\\$line" >> $docFile;
104 echo "$line" >> $docFile;
108 echo "$echoLine||" >> $docFile