mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 06:00:14 +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
|
mkdir $TMPDIR/po/ 2>/dev/null
|
||||||
rm -rf $TMPDIR/po/*
|
rm -rf $TMPDIR/po/*
|
||||||
|
(
|
||||||
|
export LC_ALL="C"
|
||||||
|
|
||||||
awk -v "po_dir"="$TMPDIR/po" '
|
awk -v "po_dir"="$TMPDIR/po" '
|
||||||
/^=head1 OPTIONS/ {
|
/^=head1 OPTIONS/ {
|
||||||
getline
|
getline
|
||||||
@@ -99,6 +102,7 @@ parse_options() {
|
|||||||
}
|
}
|
||||||
exit
|
exit
|
||||||
}' $file
|
}' $file
|
||||||
|
)
|
||||||
|
|
||||||
for opt_spec in $(ls $TMPDIR/po/); do
|
for opt_spec in $(ls $TMPDIR/po/); do
|
||||||
local opt=""
|
local opt=""
|
||||||
|
@@ -82,6 +82,11 @@ parse_options() {
|
|||||||
# from the option's POD line like "type: string; default: foo".
|
# from the option's POD line like "type: string; default: foo".
|
||||||
mkdir $TMPDIR/po/ 2>/dev/null
|
mkdir $TMPDIR/po/ 2>/dev/null
|
||||||
rm -rf $TMPDIR/po/*
|
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" '
|
awk -v "po_dir"="$TMPDIR/po" '
|
||||||
/^=head1 OPTIONS/ {
|
/^=head1 OPTIONS/ {
|
||||||
getline
|
getline
|
||||||
@@ -109,6 +114,7 @@ parse_options() {
|
|||||||
}
|
}
|
||||||
exit
|
exit
|
||||||
}' $file
|
}' $file
|
||||||
|
)
|
||||||
|
|
||||||
# Evaluate the program options into existence as global variables
|
# Evaluate the program options into existence as global variables
|
||||||
# transformed like --my-op == $OPT_MY_OP. If an option has a default
|
# transformed like --my-op == $OPT_MY_OP. If an option has a default
|
||||||
|
Reference in New Issue
Block a user