3 # filters, 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" \
42 if [[ "$target" == 'filter' || "$target" == 'audiod' ]]; then
43 for module in $FILTERS; do
44 ggo="$GGO_DIR/${module}_filter.ggo"
45 [[ ! -f "$ggo" ]] && continue
46 printf "\nOptions for the $module filter"
50 if [[ "$target" == 'write' || "$target" == 'audiod' ]]; then
51 for module in $WRITERS; do
52 ggo="$GGO_DIR/${module}_write.ggo"
53 [[ ! -f "$ggo" ]] && continue
54 printf "\nOptions for the $module writer"
64 # These must be set by the caller (make or help2man)
65 export COMMAND_LISTS FILTERS GENGETOPT GGO_DIR HELP2MAN HELP2MAN_DIR \
66 RECEIVERS VERSION WRITERS
68 # If either --version or --help-xxx was given, we are being called by help2man
69 if [[ "$1" == "--version" ]]; then
73 if [[ "$1" =~ --help- ]]; then
74 make_help "${1#--help-}"
78 # Called by make, run help2man
80 target="${output_file##*/para_}"
81 target="${target%.*}" # server, audiod, filter, ...
82 link="$HELP2MAN_DIR/para_$target"
86 for cl in $COMMAND_LISTS; do
87 if [[ "$cl" =~ lsg ]]; then
88 tempfiles+=" $cl.man_util.$$"
89 sed -e '/^\.SH / s/$/]/1' -e '/^\.SH / s/^\.SH /[/1' "$cl" > "$cl.man_util.$$"
90 cl_opts+=" --include $cl.man_util.$$"
92 cl_opts+=" --include $cl"
96 # Create a symlink para_$target, pointing to this script. This hack is
97 # necessary because help2man always includes the name of the executable in its
99 ln -sf "$PWD/$0" "$link"
101 # This will call us again twice, with either --help-$target or --version given.
102 $HELP2MAN --no-info --help-option "--help-$target" $cl_opts \
103 "$link" > "$output_file"
106 if (($ret != 0)); then