mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
Merge pull request #172 from percona/PT-76
PT-76 Fixed cmd line parsing for lines having #
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user