From 9d2f4cf7a781b89bd1e986c7cc990ef3364e4966 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 12 Apr 2016 14:10:36 +0100 Subject: [PATCH] Fix infinite loop when bad command line arguments are passed I called `aboriginal-start --cpu` and the script got stuck in an infinite loop. With this patch, it exits and outputs the --help message instead. --- aboriginal-start | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/aboriginal-start b/aboriginal-start index 87fd911..0d965df 100755 --- a/aboriginal-start +++ b/aboriginal-start @@ -35,20 +35,24 @@ while : ; do shift ;; -d|--directory) - SB_DIRECTORY=${2}; - shift 2 ;; + shift; + SB_DIRECTORY=${1}; + shift ;; -w|--workdir) - SB_WORKDIR=${2}; - shift 2 ;; + shift; + SB_WORKDIR=${1}; + shift ;; -e|--emulator) - SB_EMULATOR=${2}; - shift 2 ;; + shift; + SB_EMULATOR=${1}; + shift ;; -c|--cpus) - SB_CPUS=${2}; - shift 2 ;; + shift; + SB_CPUS=${1}; + shift ;; -s|--silent) SB_SILENT=true;