mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 02:49:02 +00:00
Use non-Bashism indirect reference in parse_options. Change $@ to ${@:-} and update parse_options in all tools.
This commit is contained in:
@@ -121,19 +121,22 @@ usage_or_errors() {
|
||||
echo
|
||||
echo "Options and values after processing arguments:"
|
||||
echo
|
||||
for opt in $(ls "$PO_DIR"); do
|
||||
local varname="OPT_$(echo "$opt" | tr a-z- A-Z_)"
|
||||
local varvalue="${!varname}"
|
||||
if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then
|
||||
if [ "$varvalue" -a "$varvalue" = "yes" ];
|
||||
then varvalue="TRUE"
|
||||
else
|
||||
varvalue="FALSE"
|
||||
(
|
||||
cd "$PO_DIR"
|
||||
for opt in *; do
|
||||
local varname="OPT_$(echo "$opt" | tr a-z- A-Z_)"
|
||||
eval local varvalue=\$$varname
|
||||
if ! grep -q "type:" "$PO_DIR/$opt" >/dev/null; then
|
||||
if [ "$varvalue" -a "$varvalue" = "yes" ];
|
||||
then varvalue="TRUE"
|
||||
else
|
||||
varvalue="FALSE"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
printf -- " --%-30s %s" "$opt" "${varvalue:-(No value)}"
|
||||
echo
|
||||
done
|
||||
printf -- " --%-30s %s" "$opt" "${varvalue:-(No value)}"
|
||||
echo
|
||||
done
|
||||
)
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user