mirror of
https://github.com/DictXiong/dotfiles.git
synced 2024-11-24 16:17:00 +08:00
bug fix
This commit is contained in:
parent
b2a1896cb9
commit
d485f1d8c2
|
@ -102,8 +102,9 @@ if [[ "$EUID" != "0" && -x $(command -v sudo) ]]; then
|
|||
SUDO='sudo'
|
||||
fi
|
||||
|
||||
# arg parse
|
||||
ARG=""
|
||||
parse_arg()
|
||||
{
|
||||
local ORIGIN_ARG ARG=""
|
||||
ARG_PARSED=()
|
||||
while [[ $# > 0 || -n "$ARG" ]]; do
|
||||
if [[ -z "$ARG" ]]; then ARG=$1 ORIGIN_ARG=$1; shift; fi
|
||||
|
@ -119,8 +120,7 @@ while [[ $# > 0 || -n "$ARG" ]]; do
|
|||
ARG=-${ARG:2}
|
||||
fi
|
||||
done
|
||||
unset ARG ORIGIN_ARG
|
||||
|
||||
}
|
||||
|
||||
ask_for_yN()
|
||||
{
|
||||
|
@ -190,4 +190,5 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|||
$1 "${@:2}"
|
||||
else
|
||||
setup_color
|
||||
parse_arg "$@"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user