mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-09 01:04:44 +08:00
Merge pull request #172 from percona/PT-76
PT-76 Fixed cmd line parsing for lines having #
This commit is contained in:
@@ -127,6 +127,7 @@ HAVE_EXT_ARGV="" # Got --, everything else is put into EXT_ARGV
|
||||
OPT_ERRS=0 # How many command line option errors
|
||||
OPT_VERSION="" # If --version was specified
|
||||
OPT_HELP="" # If --help was specified
|
||||
OPT_ASK_PASS="" # If --ask-pass was specified
|
||||
PO_DIR="" # Directory with program option spec files
|
||||
|
||||
usage() {
|
||||
@@ -227,6 +228,7 @@ parse_options() {
|
||||
OPT_ERRS=0
|
||||
OPT_VERSION=""
|
||||
OPT_HELP=""
|
||||
OPT_ASK_PASS=""
|
||||
PO_DIR="$PT_TMPDIR/po"
|
||||
|
||||
if [ ! -d "$PO_DIR" ]; then
|
||||
@@ -364,7 +366,7 @@ _parse_config_files() {
|
||||
|
||||
echo "$config_opt" | grep '^[ ]*[^#]' >/dev/null 2>&1 || continue
|
||||
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/[ ]*#.*$//')"
|
||||
config_opt="$(echo "$config_opt" | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/[ ]*=[ ]*/=/' -e 's/[ ]+#.*$//')"
|
||||
|
||||
[ "$config_opt" = "" ] && continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user