Skip to content

Commit

Permalink
Issue #58: clean up prompt logic in todeClient ... also handle option…
Browse files Browse the repository at this point in the history
… arg to -p [ci skip]
  • Loading branch information
dalehenrich committed Mar 24, 2015
1 parent 34251c6 commit 211fc9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion bin/createTodeImage
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ if [ "${GS_HOME}x" = "x" ] ; then
fi

postFix=""
while getopts "hp:" OPT ; do
while getopts ":hp:" OPT ; do
case "$OPT" in
h) usage; exit 0;;
p) postFix="${OPTARG}";;
?) postFix="";; # handle optional -p argument "
*) usage; exit 1;;
esac
done
Expand Down
7 changes: 4 additions & 3 deletions bin/todeClient
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ fi

if [ ! -e $pharo/todeClient${postFix}.image ] ; then
echo "The requested todeClient image: $pharo/todeClient${postFix}.image does not exist"
while true; do
read -p "Do you wish to create todeClient${postFix}?" yn
created="false"
while [ "$created" = "false" ] ; do
read -p "Do you wish to create todeClient${postFix}? [y/n]" yn
case $yn in
[Yy]* ) $GS_HOME/bin/createTodeImage -p ${postFix};;
[Yy]* ) $GS_HOME/bin/createTodeImage -p ${postFix}; created="true" ;;
[Nn]* ) exit 1;;
* ) echo "Please answer yes or no.";;
esac
Expand Down

0 comments on commit 211fc9b

Please sign in to comment.