3 # writers are called "modules" in this script
8 $GENGETOPT --show-detailed-help \
11 < "$ggo" | awk 'BEGIN {
23 if ($0 ~ /^Usage: /) {
34 local target="$1" module ggo
37 $GENGETOPT --show-detailed-help \
38 --set-version "$VERSION" \
39 --set-package "para_$1" \
48 # These must be set by the caller (make or help2man)
49 export COMMAND_LISTS FILTERS GENGETOPT GGO_DIR HELP2MAN HELP2MAN_DIR \
50 RECEIVERS VERSION WRITERS
52 # If either --version or --help-xxx was given, we are being called by help2man
53 if [[ "$1" == "--version" ]]; then
57 if [[ "$1" =~ --help- ]]; then
58 make_help "${1#--help-}"
62 # Called by make, run help2man
64 target="${output_file##*/para_}"
65 target="${target%.*}" # server, audiod, filter, ...
66 link="$HELP2MAN_DIR/para_$target"
70 for cl in $COMMAND_LISTS; do
71 tempfiles+=" $cl.man_util.$$"
72 sed -e '/^\.SH / s/$/]/1' -e '/^\.SH / s/^\.SH /[/1' "$cl" > "$cl.man_util.$$"
73 cl_opts+=" --include $cl.man_util.$$"
76 # Create a symlink para_$target, pointing to this script. This hack is
77 # necessary because help2man always includes the name of the executable in its
79 ln -sf "$PWD/$0" "$link"
81 # This will call us again twice, with either --help-$target or --version given.
82 $HELP2MAN --no-info --help-option "--help-$target" $cl_opts \
83 "$link" > "$output_file"
86 if (($ret != 0)); then