7 echo ".name = \"$name_txt\","
8 if test $line_handler -eq 0; then
9 echo ".handler = com_$name_txt,"
11 echo ".handler = NULL,"
12 echo ".line_handler = com_$name_txt,"
14 if test -n "$perms_txt"; then
15 echo ".perms = $perms_txt,"
17 echo ".description = \"$desc_txt\","
18 echo ".synopsis = \"$syn_txt\","
20 echo "$help_txt" | sed -e 's/^/\"/g' -e 's/$/\\n\"/g'
28 while read key value; do
34 header_comment="$value"
37 c_file_comment="$value"
41 array_name=${value%command_list}cmds
52 #include \"$file_name.h\""
56 if test -z "$header_comment" -o -z "$c_file_comment" \
57 -o -z "$file_name"; then
58 echo "header error" 1&>2
74 while read key value; do
97 if test "$line" = "---"; then
108 if test -n "$name_txt" -a -n "$desc_txt" -a -n "$syn_txt" \
109 -a -n "$help_txt"; then
113 if test -z "$name_txt" -a -z "$desc_txt" -a -z "$syn_txt" \
114 -a -z "$help_txt"; then
131 printf "\t$name_txt - $desc_txt\n"
133 printf "\t$syn_txt\n"
136 if test -n "$perms_txt"; then
138 if test "$perms_txt" = "0"; then
141 printf "\t$perms_txt\n"
150 local cn="$(grep ^codename Makefile.in)"
151 local ver="$(grep ^AC_INIT configure.ac \
156 echo "r=paraslash-$ver (cn: $cn)"
159 local mandir=man/man1
162 mkdir -p $txtdir $mandir $htmldir || exit 1
165 if test $ret -lt 0; then
168 if test $ret -eq 0; then
172 echo "pfx: $pfx, name: $n"
173 dump_man > $txtdir/$n.txt
174 txt2man -t "$n" -r "$r" < $txtdir/$n.txt \
175 | sed -e 1d > $mandir/$n.1
176 man2html $mandir/$n.1 > $htmldir/$n.html
182 echo "/** \file $file_name.c $c_file_comment */"
184 echo "struct $array_type $array_name[] = {"
187 if test $ret -lt 0; then
190 if test $ret -eq 0; then
195 echo '{.name = NULL}};'
203 echo ' * \param fd the file descriptor to send output to'
204 if test $line_handler -eq 0; then
205 echo ' * \param argc the number of arguments'
206 echo ' * \param argv the argument vector'
208 echo ' * \param cmdline the full command line'
211 echo " * synopsis: $syn_txt"
213 echo "$help_txt" | sed -e 's/^/ * /g'
215 if test $line_handler -eq 0; then
216 echo "int com_$name_txt(int fd, int argc, char **argv);"
218 echo "int com_$name_txt(int fd, char *cmdline);"
225 echo "/** \file $file_name.h $header_comment */"
227 echo "extern struct $array_type $array_name[];"
230 if test $ret -lt 0; then
233 if test $ret -eq 0; then