Added readline support through rlwrap

master
Mike Gerwitz 2011-10-02 15:15:32 -04:00
parent 928a8c5463
commit e82cf7c710
1 changed files with 8 additions and 1 deletions

View File

@ -4,13 +4,20 @@ mypath="$( dirname $0 )"
cmd="$mypath/showscene" cmd="$mypath/showscene"
getnext="$mypath/getval _scene" getnext="$mypath/getval _scene"
. "$mypath/common"
scene="$( $getnext )" scene="$( $getnext )"
if [ ! "$scene" ]; then if [ ! "$scene" ]; then
scene='start' scene='start'
fi fi
while [ "$scene" ]; do while [ "$scene" ]; do
$cmd $scene # if rlwrap is found on the system, use it to provide readline capabilities
# (which will hopefully prevent ragequits to due re-typing long, mistyped
# commands)
which rlwrap >/dev/null && {
rlwrap -H "$GSGP_PROFILE_PATH/.history" $cmd $scene
} || $cmd $scene
# if the scene stated that we should end, then we should probably end # if the scene stated that we should end, then we should probably end
if [ $? -eq 100 ]; then if [ $? -eq 100 ]; then