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 ".usage = \"$usage_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\""
58 if test -z "$header_comment" -o -z "$c_file_comment" \
59 -o -z "$file_name"; then
60 echo "header error" 1&>2
76 while read key value; do
99 if test "$line" = "---"; then
110 if test -n "$name_txt" -a -n "$desc_txt" -a -n "$usage_txt" \
111 -a -n "$help_txt"; then
115 if test -z "$name_txt" -a -z "$desc_txt" -a -z "$usage_txt" \
116 -a -z "$help_txt"; then
132 echo ".SS \"$name_txt\""
135 echo "\\fBusage: \\fP$usage_txt"
139 if test -n "$perms_txt"; then
140 echo -n "\\fBpermissions:\\fP "
141 if test "$perms_txt" = "0"; then
153 echo "[$section_name]"
157 if test $ret -lt 0; then
160 if test $ret -eq 0; then
169 echo "/** \file $file_name.c $c_file_comment */"
171 echo "struct $array_type $array_name[] = {"
174 if test $ret -lt 0; then
177 if test $ret -eq 0; then
182 echo '{.name = NULL}};'
190 echo ' * \param fd the file descriptor to send output to'
191 if test $line_handler -eq 0; then
192 echo ' * \param argc the number of arguments'
193 echo ' * \param argv the argument vector'
195 echo ' * \param cmdline the full command line'
198 echo " * usage: $usage_txt"
200 echo "$help_txt" | sed -e 's/^/ * /g'
202 if test $line_handler -eq 0; then
203 echo "int com_$name_txt(int fd, int argc, char **argv);"
205 echo "int com_$name_txt(int fd, char *cmdline);"
212 echo "/** \file $file_name.h $header_comment */"
214 echo "extern struct $array_type $array_name[];"
217 if test $ret -lt 0; then
220 if test $ret -eq 0; then