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

38
zpac
View File

@ -138,40 +138,6 @@ abs.get() {
svn checkout "svn://svn.archlinux.org/${svn_repo}/${1}/trunk" "${cfg_workdir}/${1}" 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() { main() {
if [[ -f "$HOME/.config/zpac.rc.sh" ]]; then if [[ -f "$HOME/.config/zpac.rc.sh" ]]; then
source "$HOME/.config/zpac.rc.sh" source "$HOME/.config/zpac.rc.sh"
@ -214,7 +180,7 @@ main() {
return 1 return 1
;; ;;
esac esac
done done <<< "$1"
;; ;;
(*) shift; break;; (*) shift; break;;
@ -300,4 +266,4 @@ main() {
esac esac
} }
main $(args_norm "$@") main "$@"