Fix: Ensure to grep at least one "-"
This commit is contained in:
parent
4535850b3a
commit
60c307b933
|
@ -225,7 +225,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then
|
||||||
|
|
||||||
manage_arg="0"
|
manage_arg="0"
|
||||||
# Parse all options (start with a "-") one by one
|
# Parse all options (start with a "-") one by one
|
||||||
while printf -- '%s' "${1}" | grep -q -E -- "^-*"; do
|
while printf -- '%s' "${1}" | grep -q -E -- "^-+"; do
|
||||||
|
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
-h|--help ) ## help
|
-h|--help ) ## help
|
||||||
|
|
|
@ -320,7 +320,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then
|
||||||
manage_arg="0"
|
manage_arg="0"
|
||||||
|
|
||||||
## If the first argument is not an option
|
## If the first argument is not an option
|
||||||
if ! printf -- '%s' "${1}" | grep -q -E -- "^-*";
|
if ! printf -- '%s' "${1}" | grep -q -E -- "^-+";
|
||||||
then
|
then
|
||||||
## Use this argument for sge_hostname
|
## Use this argument for sge_hostname
|
||||||
sge_hostname="${1}"
|
sge_hostname="${1}"
|
||||||
|
@ -337,7 +337,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Parse all options (start with a "-") one by one
|
# Parse all options (start with a "-") one by one
|
||||||
while printf -- '%s' "${1}" | grep -q -E -- "^-*"; do
|
while printf -- '%s' "${1}" | grep -q -E -- "^-+"; do
|
||||||
|
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
-d|--debug ) ## debug
|
-d|--debug ) ## debug
|
||||||
|
|
Loading…
Reference in New Issue