From: Andre Noll Date: Sun, 23 Sep 2007 20:20:24 +0000 (+0200) Subject: command_util.sh: Fix man output for templates. X-Git-Tag: v0.3.0~366 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=03273d73589ffd1bd34ae2c25bdb66c6ae44fa64;ds=sidebyside command_util.sh: Fix man output for templates. --- diff --git a/command_util.sh b/command_util.sh index a71bb651..62a406c7 100755 --- a/command_util.sh +++ b/command_util.sh @@ -137,10 +137,29 @@ ${line# }" dump_man() { - echo ".SS \"$name_txt\"" - echo "$desc_txt" - echo - echo "\\fBusage: \\fP$usage_txt" + if test $template -eq 0; then + echo ".SS \"$name_txt\"" + echo "$desc_txt" + echo + echo "\\fBUsage: \\fP$usage_txt" + else + for member in $template_members; do + local sed_cmd="sed -e s/@member@/$member/g" + local t_name_txt=$(echo $name_txt | $sed_cmd) + echo ".SS \"$t_name_txt\"" + done + echo "$desc_txt" + echo + echo "\\fBUsage: \\fP" + echo + echo ".nf" + for member in $template_members; do + local sed_cmd="sed -e s/@member@/$member/g" + local t_usage_txt=$(echo $usage_txt | $sed_cmd) + printf "\t$t_usage_txt\n" + done + echo ".fi" + fi echo echo "$help_txt" echo