Merge pull request #172 from percona/PT-76

PT-76 Fixed cmd line parsing for lines having #
This commit is contained in:
Carlos Salguero
2017-03-21 19:23:37 +02:00
committed by GitHub
8 changed files with 22 additions and 8 deletions

View File

@@ -73,6 +73,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() {
@@ -173,6 +174,7 @@ parse_options() {
OPT_ERRS=0
OPT_VERSION=""
OPT_HELP=""
OPT_ASK_PASS=""
PO_DIR="$PT_TMPDIR/po"
if [ ! -d "$PO_DIR" ]; then
@@ -310,7 +312,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

View File

@@ -114,6 +114,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() {
@@ -214,6 +215,7 @@ parse_options() {
OPT_ERRS=0
OPT_VERSION=""
OPT_HELP=""
OPT_ASK_PASS=""
PO_DIR="$PT_TMPDIR/po"
if [ ! -d "$PO_DIR" ]; then
@@ -351,7 +353,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

View File

@@ -314,7 +314,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

View File

@@ -116,6 +116,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() {
@@ -216,6 +217,7 @@ parse_options() {
OPT_ERRS=0
OPT_VERSION=""
OPT_HELP=""
OPT_ASK_PASS=""
PO_DIR="$PT_TMPDIR/po"
if [ ! -d "$PO_DIR" ]; then
@@ -353,7 +355,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

View File

@@ -114,6 +114,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() {
@@ -214,6 +215,7 @@ parse_options() {
OPT_ERRS=0
OPT_VERSION=""
OPT_HELP=""
OPT_ASK_PASS=""
PO_DIR="$PT_TMPDIR/po"
if [ ! -d "$PO_DIR" ]; then
@@ -351,7 +353,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

View File

@@ -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

View File

@@ -82,6 +82,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() {
@@ -182,6 +183,7 @@ parse_options() {
OPT_ERRS=0
OPT_VERSION=""
OPT_HELP=""
OPT_ASK_PASS=""
PO_DIR="$PT_TMPDIR/po"
if [ ! -d "$PO_DIR" ]; then
@@ -319,7 +321,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