Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike@mikegerwitz.com>2011-10-02 15:15:32 -0400
committerMike Gerwitz <mike@mikegerwitz.com>2011-10-02 15:15:32 -0400
commite82cf7c7109a93eff1be8738ef54958906c91f3a (patch)
tree44bfff59621966bf83dfde30ceacdac7c0167651
parent928a8c5463704be9a1a0deba1b3e0e35546c9c96 (diff)
downloadgsgp-e82cf7c7109a93eff1be8738ef54958906c91f3a.tar.gz
gsgp-e82cf7c7109a93eff1be8738ef54958906c91f3a.tar.bz2
gsgp-e82cf7c7109a93eff1be8738ef54958906c91f3a.zip
Added readline support through rlwrap
-rwxr-xr-xutil/scene-runner9
1 files changed, 8 insertions, 1 deletions
diff --git a/util/scene-runner b/util/scene-runner
index 5d8ce4f..f199eb1 100755
--- a/util/scene-runner
+++ b/util/scene-runner
@@ -4,13 +4,20 @@ mypath="$( dirname $0 )"
cmd="$mypath/showscene"
getnext="$mypath/getval _scene"
+. "$mypath/common"
+
scene="$( $getnext )"
if [ ! "$scene" ]; then
scene='start'
fi
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 [ $? -eq 100 ]; then