Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
blob: f199eb1df6e11ed2df451e5f7c10668fe90de02e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

mypath="$( dirname $0 )"
cmd="$mypath/showscene"
getnext="$mypath/getval _scene"

. "$mypath/common"

scene="$( $getnext )"
if [ ! "$scene" ]; then
    scene='start'
fi

while [ "$scene" ]; do
    # 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
        exit
    fi

    scene="$( $getnext )"
done