From f5665923655e8743376969b27ddd8feee47eb84a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 27 Aug 2013 23:15:41 +0200 Subject: version common bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/argparser.bash | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/argparser.bash') diff --git a/src/argparser.bash b/src/argparser.bash index e7d65cd..99711c3 100644 --- a/src/argparser.bash +++ b/src/argparser.bash @@ -635,7 +635,7 @@ function args_help # @exit Whether no unrecognised option is used function args_parse { - local nulqueue=() argqueue=() optqueue=() queue=() opt arg _arg argnull trigger + local nulqueue=() argqueue=() optqueue=() queue=() opt arg _arg argnull trigger value local dashed=0 tmpdashed=0 get=0 dontget=0 rc=0 i n more std sign type opt_arg passed args_argcount=$# @@ -707,9 +707,10 @@ function args_parse if [ -e "${args_optmap}/${_arg}" ]; then type="$(head -n 2 < "${args_optmap}/${_arg}" | tail -n 1)" fi + value="${arg#*=}" if [ ! $type = x ] && (( $type >= ${args_ARGUMENTED} )); then optqueue+=( "${_arg}" ) - argqueue+=( "${arg#*=}" ) + argqueue+=( "${value}" ) nulqueue+=( 0 ) std="$(head -n 1 < "${args_optmap}/${_arg}")" trigger="$(tail -n 1 < "${args_optmap}/${_arg}")" @@ -717,13 +718,13 @@ function args_parse dashed=1 "$trigger" "${_arg}" "${std}" else - "$trigger" "${_arg}" "${std}" "${arg#*=}" + "$trigger" "${_arg}" "${std}" "${value}" fi else arg="${_arg}" _arg="$(args__abbreviations "${arg}")" if [ $? = 0 ]; then - arg=( "${_arg}" "$@" ) + arg=( "${_arg}=${value}" "$@" ) set -- "${arg[@]}" else (( args_unrecognised_count++ )) -- cgit v1.2.3-70-g09d2