mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-14 07:06:28 +00:00
Use "yes" for true, "" for false. Use $PO_DIR instead of $TMP_DIR/po. Add and test Baron's code for 'Options and values after processing arguments'. Make --help exit 0 unless there were errors.
This commit is contained in:
@@ -91,12 +91,20 @@ usage_or_errors() {
|
||||
echo
|
||||
echo "Command line options:"
|
||||
echo
|
||||
for opt in $(ls $TMPDIR/po/); do
|
||||
for opt in $(ls "$PO_DIR"); do
|
||||
local desc=$(cat $TMPDIR/po/$opt | grep '^desc:' | sed -e 's/^desc://')
|
||||
echo "--$opt"
|
||||
echo " $desc"
|
||||
echo
|
||||
done
|
||||
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}"
|
||||
printf -- " --%-30s %s" "$opt" "${varvalue:-(No value)}"
|
||||
echo
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user