From 03273d73589ffd1bd34ae2c25bdb66c6ae44fa64 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 23 Sep 2007 22:20:24 +0200 Subject: [PATCH] command_util.sh: Fix man output for templates. --- command_util.sh | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) 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 -- 2.30.2