From b1c30ca7f7435f24e895f44763dcac60b1aa5cba Mon Sep 17 00:00:00 2001 From: mjwybrow Date: Thu, 15 Mar 2007 05:26:38 +0000 Subject: [PATCH] * packaging/macosx/osx-app.sh: Improve the comand line option processing. --- packaging/macosx/osx-app.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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` -- 2.30.2