]> git.tue.mpg.de Git - paraslash.git/commitdiff
command_util.sh: Fix man output for templates.
authorAndre Noll <maan@systemlinux.org>
Sun, 23 Sep 2007 20:20:24 +0000 (22:20 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 23 Sep 2007 20:20:24 +0000 (22:20 +0200)
command_util.sh

index a71bb6518f9194c999298e114b25636086d19ba8..62a406c72778bf10cd7f7889b288a9a786448a7f 100755 (executable)
@@ -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