Skip to content

Commit 211fc9b

Browse files
committed
Issue #58: clean up prompt logic in todeClient ... also handle option arg to -p [ci skip]
1 parent 34251c6 commit 211fc9b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: bin/createTodeImage

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ if [ "${GS_HOME}x" = "x" ] ; then
3636
fi
3737

3838
postFix=""
39-
while getopts "hp:" OPT ; do
39+
while getopts ":hp:" OPT ; do
4040
case "$OPT" in
4141
h) usage; exit 0;;
4242
p) postFix="${OPTARG}";;
43+
?) postFix="";; # handle optional -p argument "
4344
*) usage; exit 1;;
4445
esac
4546
done

Diff for: bin/todeClient

+4-3
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ fi
5959

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

0 commit comments

Comments
 (0)