mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
Merge ~daniel-nichter/percona-toolkit/bash-tool-libs r123.
This commit is contained in:
@@ -74,6 +74,9 @@ parse_options() {
|
||||
|
||||
mkdir $TMPDIR/po/ 2>/dev/null
|
||||
rm -rf $TMPDIR/po/*
|
||||
(
|
||||
export LC_ALL="C"
|
||||
|
||||
awk -v "po_dir"="$TMPDIR/po" '
|
||||
/^=head1 OPTIONS/ {
|
||||
getline
|
||||
@@ -99,6 +102,7 @@ parse_options() {
|
||||
}
|
||||
exit
|
||||
}' $file
|
||||
)
|
||||
|
||||
for opt_spec in $(ls $TMPDIR/po/); do
|
||||
local opt=""
|
||||
|
@@ -82,6 +82,11 @@ parse_options() {
|
||||
# from the option's POD line like "type: string; default: foo".
|
||||
mkdir $TMPDIR/po/ 2>/dev/null
|
||||
rm -rf $TMPDIR/po/*
|
||||
(
|
||||
# awk is stupid on some systems (e.g. Ubuntu 10) such that
|
||||
# /^[a-z]/ incorrectly matches "Foo". This fixes that.
|
||||
export LC_ALL="C"
|
||||
|
||||
awk -v "po_dir"="$TMPDIR/po" '
|
||||
/^=head1 OPTIONS/ {
|
||||
getline
|
||||
@@ -109,6 +114,7 @@ parse_options() {
|
||||
}
|
||||
exit
|
||||
}' $file
|
||||
)
|
||||
|
||||
# Evaluate the program options into existence as global variables
|
||||
# transformed like --my-op == $OPT_MY_OP. If an option has a default
|
||||
|
Reference in New Issue
Block a user