From 85a70911e1e4be55d95468bfe80a405bf894a87c Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 24 Jul 2016 02:48:49 +0200 Subject: [PATCH] Add support of command-line-arguments to run.sh --- run.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index 4bece845c..0b8974f12 100755 --- a/run.sh +++ b/run.sh @@ -2,12 +2,14 @@ set -eu BUILD="Release" + UNTIL_CLEAN_EXIT=0 +ASF_ARGS=() MONO_ARGS=("--llvm" "--server" "-O=all") PRINT_USAGE() { - echo "Usage: $0 [--until-clean-exit] [debug/release]" + echo "Usage: $0 [--until-clean-exit] [--cryptkey=] [--path=] [--server] [debug/release]" exit 1 } @@ -15,6 +17,9 @@ for ARG in "$@"; do case "$ARG" in release|Release) BUILD="Release" ;; debug|Debug) BUILD="Debug" ;; + --cryptkey=*) ASF_ARGS+=("--cryptkey=$(echo "$ARG" | cut -d '=' -f 2-)") ;; + --path=*) ASF_ARGS+=("--path=$(echo "$ARG" | cut -d '=' -f 2-)") ;; + --server) ASF_ARGS+=("--server") ;; --until-clean-exit) UNTIL_CLEAN_EXIT=1 ;; *) PRINT_USAGE esac @@ -34,12 +39,12 @@ if [[ ! -f "$BINARY" ]]; then fi if [[ "$UNTIL_CLEAN_EXIT" -eq 0 ]]; then - mono "${MONO_ARGS[@]}" "$BINARY" + mono "${MONO_ARGS[@]}" "$BINARY" "${ASF_ARGS[@]}" exit $? fi while [[ -f "$BINARY" ]]; do - if mono "${MONO_ARGS[@]}" "$BINARY"; then + if mono "${MONO_ARGS[@]}" "$BINARY" "${ASF_ARGS[@]}"; then break fi sleep 1