From: mjwybrow Date: Thu, 15 Mar 2007 05:26:38 +0000 (+0000) Subject: * packaging/macosx/osx-app.sh: Improve the comand line option processing. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b1c30ca7f7435f24e895f44763dcac60b1aa5cba;p=inkscape.git * packaging/macosx/osx-app.sh: Improve the comand line option processing. --- diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh index cdd4359cc..6fc9980c6 100755 --- a/packaging/macosx/osx-app.sh +++ b/packaging/macosx/osx-app.sh @@ -71,27 +71,29 @@ fi pkg=Inkscape package="$pkg.app" -# TODO: Rewrite handling of command line args and make more robust. strip=false -if [ "$1" = "-s" ]; then - strip=true - shift -fi +while getopts 's' flag; do + case $flag in + s) strip=true ;; + \?) echo "Invalid command line option."; exit 1 ;; + *) echo "Internal error in getopts."; exit 2 ;; + esac +done +shift `expr $OPTIND - 1`; + binary="$1" if [ ! -x "$binary" ]; then echo "Not executable: $binary" >&2 exit 1 fi -shift -plist="$1" +plist="$2" if [ ! -f "$plist" ]; then echo "Need plist file" >&2 exit 1 fi -shift # Set the 'macosx' directory, usually the current directory. resdir=`pwd`