for source_file in $source_files; do
match=$(grep "^\(__noreturn \)*int com_$name_txt(" $source_file | head -n 1 | sed -e 's/$/;/1')
if test -n "$match"; then
- result="$result $match$CR"
+ result="$result$match$CR"
break
fi
done
- echo
}
make_array_member()
make_completion()
{
- result=" {.name = \"$name_txt\", .completer = ${name_txt}_completer}, \\"
+ local CR='
+'
+ result=" {.name = \"$name_txt\", .completer = ${name_txt}_completer}, \\$CR"
}
template_loop()
{
+ local loop_result=
+
local t_name="$name_txt"
local t_perms="$perms_txt"
local t_desc="$desc_txt"
usage_txt=$(echo "$t_usage" | $sed_cmd)
help_txt=$(printf "%s\n" "$t_help" | $sed_cmd)
prototype=$(echo "$template_prototype" | $sed_cmd)
- result=
$1
- echo "$result"
+ loop_result="$loop_result$result"
done
-
+ result="$loop_result"
}
com_c_file()
fi
if test $template -eq 0; then
make_array_member
- echo "$result"
+ printf "%s" "$result"
continue
fi
template_loop make_array_member
+ printf "%s" "$result"
done
echo '{.name = NULL}};'
}
fi
if test $template -eq 0; then
make_proto
- echo "$result"
+ printf "%s" "$result"
continue
fi
template_loop make_proto
+ printf "%s" "$result"
done
}
fi
if test $template -eq 0; then
make_completion
- echo "$result"
+ printf "%s" "$result"
continue
fi
template_loop make_completion
+ printf "%s" "$result"
done
echo
}