args_norm is not needed now.

+ a bugfix.
This commit is contained in:
Jack L. Frost 2015-02-06 13:42:10 +03:00
parent 07d1805d13
commit 422adf3d47
1 changed files with 2 additions and 36 deletions

38
zpac
View File

@ -138,40 +138,6 @@ abs.get() {
svn checkout "svn://svn.archlinux.org/${svn_repo}/${1}/trunk" "${cfg_workdir}/${1}"
}
args_norm() {
while (( $# )); do
unset -v arg opt c keys
case "$1" in
--) printf '%s\n' '--'; break;;
--*)
IFS='=' read -r arg opt <<< "$1"
printf '%s\n' "$arg"
[[ "$opt" ]] && {
printf '%s\n' "$opt"
}
;;
-*)
while read -r -n1 c
do
case "$c" in
-|'') :;;
*) keys+=( "-$c" );;
esac
done <<< "$1"
printf '%s\n' "${keys[@]}"
;;
*) printf '%s\n' "$1";;
esac
shift
done
}
main() {
if [[ -f "$HOME/.config/zpac.rc.sh" ]]; then
source "$HOME/.config/zpac.rc.sh"
@ -214,7 +180,7 @@ main() {
return 1
;;
esac
done
done <<< "$1"
;;
(*) shift; break;;
@ -300,4 +266,4 @@ main() {
esac
}
main $(args_norm "$@")
main "$@"