# Pass back the list of options we consumed.
func_quote_for_eval ${1+"$@"}
- func_run_hooks_result="$func_quote_for_eval_result"
+ bootstrap_options_prep_result="$func_quote_for_eval_result"
}
func_add_hook func_options_prep bootstrap_options_prep
# bootstrap_parse_options [ARG]...
# --------------------------------
-# Provide handling for Bootstrap specific options. Note
-# `func_parse_options' passes in the unconsumed positional parameters, and
-# this function has to pass back whatever remains after its own
-# processing in the `func_run_hooks_result' variable.
+# Provide handling for Bootstrap specific options.
bootstrap_parse_options ()
{
$debug_cmd
# save modified positional parameters for caller
func_quote_for_eval ${1+"$@"}
- func_run_hooks_result="$func_quote_for_eval_result"
+ bootstrap_parse_options_result="$func_quote_for_eval_result"
}
func_add_hook func_parse_options bootstrap_parse_options
# Pass back the list of unconsumed options left.
func_quote_for_eval ${1+"$@"}
- func_run_hooks_result="$func_quote_for_eval_result"
+ bootstrap_validate_options_result="$func_quote_for_eval_result"
}
# pass back the list of options we consumed
func_quote_for_eval ${1+"$@"}
- func_run_hooks_result="$func_quote_for_eval_result"
+ libtool_options_prep_result="$func_quote_for_eval_result"
}
func_add_hook func_options_prep libtool_options_prep
# libtool_parse_options [ARG...]
# ------------------------------
# Provide handling for additional Libtool options inside the main option
-# parsing loop. Note that `bootstrap' passes in the current positional
-# parameters, and this function has to pass back whatever is left after
-# its own processing in the `func_run_hooks_result' variable.
+# parsing loop.
libtool_parse_options ()
{
$debug_cmd
# pass back the list of options we consumed
func_quote_for_eval ${1+"$@"}
- func_run_hooks_result="$func_quote_for_eval_result"
+ libtool_parse_options_result="$func_quote_for_eval_result"
}
func_add_hook func_parse_options libtool_parse_options
# pass back the list of options we consumed
func_quote_for_eval ${1+"$@"}
- func_run_hooks_result="$func_quote_for_eval_result"
+ libtool_validate_options_result="$func_quote_for_eval_result"
}
func_add_hook func_validate_options libtool_validate_options
#! /bin/sh
# Set a version string for this script.
-scriptversion=2011-11-04.03; # UTC
+scriptversion=2011-11-16.05; # UTC
# A pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
*) func_fatal_error "\`$1' does not support hook funcions.n" ;;
esac
- eval _G_hook_fns="\$$1_hooks"
-
- # shift away the first argument (FUNC_NAME)
- shift
- func_quote_for_eval ${1+"$@"}
- func_run_hooks_result=$func_quote_for_eval_result
+ eval _G_hook_fns="\$$1_hooks"; shift
for _G_hook in $_G_hook_fns; do
eval $_G_hook '"$@"'
# store returned options list back into positional
# parameters for next `cmd' execution.
- eval set dummy $func_run_hooks_result; shift
+ eval set dummy \$${_G_hook}_result; shift
done
+
+ func_quote_for_eval ${1+"$@"}
+ func_run_hooks_result=$func_quote_for_eval_result
}
# In order to add your own option parsing hooks, you must accept the
# full positional parameter list in your hook function, remove any
# options that you action, and then pass back the remaining unprocessed
-# options in `func_run_hooks_result', escaped suitably for `eval'. Like
-# this:
+# options in `<hooked_function_name>_result', escaped suitably for
+# `eval'. Like this:
#
# my_options_prep ()
# {
# '
#
# func_quote_for_eval ${1+"$@"}
-# func_run_hooks_result=$func_quote_for_eval_result
+# my_options_prep_result=$func_quote_for_eval_result
# }
# func_add_hook func_options_prep my_options_prep
#
# done
#
# func_quote_for_eval ${1+"$@"}
-# func_run_hooks_result=$func_quote_for_eval_result
+# my_silent_option_result=$func_quote_for_eval_result
# }
# func_add_hook func_parse_options my_silent_option
#
# \`--silent' and \`--verbose' options are mutually exclusive."
#
# func_quote_for_eval ${1+"$@"}
-# func_run_hooks_result=$func_quote_for_eval_result
+# my_option_validation_result=$func_quote_for_eval_result
# }
+# func_add_hook func_validate_options my_option_validation
#
# You'll alse need to manually amend $usage_message to reflect the extra
# options you parse. It's preferable to append if you can, so that