ARGS=`getopt -o A:h -al ARCH:,help -- "$@"`
[ $? -ne 0 ] && help
eval set -- "${ARGS}"
ARCH=""
OPT=""
TAB=" "
while true
do
case "$1" in
-A|--ARCH)
ARCH="$2"
shift
;;
-h|--help)
help
;;
--)
shift
break
;;
esac
shift
[ $? -ne 0 ] && help
eval set -- "${ARGS}"
ARCH=""
OPT=""
TAB=" "
while true
do
case "$1" in
-A|--ARCH)
ARCH="$2"
shift
;;
-h|--help)
help
;;
--)
shift
break
;;
esac
shift
done
http://wangxiaoyu.blog.51cto.com/922065/624159