X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=man_util.bash;h=687acaab5510dab25cc83a2e65b319359d85b3d0;hp=cb7519c9c6fb0098c6a1f9dc8c39d29c3ead1bee;hb=534a94f441767947874cb15d18211edf758e9277;hpb=56df9bb38aa4725f9244a7898d765608d8a1fffa diff --git a/man_util.bash b/man_util.bash index cb7519c9..687acaab 100755 --- a/man_util.bash +++ b/man_util.bash @@ -90,8 +90,15 @@ target="${target%.*}" # server, audiod, filter, ... link="$HELP2MAN_DIR/para_$target" cl_opts= +tempfiles= for cl in $COMMAND_LISTS; do - cl_opts+=" --include $cl" + if [[ "$cl" =~ lsg ]]; then + tempfiles+=" $cl.man_util.$$" + sed -e '/^\.SH / s/$/]/1' -e '/^\.SH / s/^\.SH /[/1' "$cl" > "$cl.man_util.$$" + cl_opts+=" --include $cl.man_util.$$" + else + cl_opts+=" --include $cl" + fi done # Create a symlink para_$target, pointing to this script. This hack is @@ -102,7 +109,9 @@ ln -sf "$PWD/$0" "$link" # This will call us again twice, with either --help-$target or --version given. $HELP2MAN --no-info --help-option "--help-$target" $cl_opts \ "$link" > "$output_file" -if (($? != 0)); then +ret=$? +rm -f $tempfiles +if (($ret != 0)); then rm -f "$output_file" exit 1 fi