diff --git a/scratch/src/scratch b/scratch/src/scratch index 5ca37e0..bd8c95a 100644 --- a/scratch/src/scratch +++ b/scratch/src/scratch @@ -25,16 +24,29 @@ export SQUEAK_FAKEBIGCURSOR=0 usage() { - echo "Usage: scratch [--param value] [-vmopt value] [arg value]" + echo "Usage: scratch [--help] [--param value] [-vmopt value] [arg value]" echo " where --param is --vm, --image, or --document;" echo " -vmopt is an option passed to the Squeak VM;" echo " and args are passed to the Squeak image." } -while [ -n "$1" ] ; do +if [ $# -eq 1 ] ; then + case "$1" in + --help) + usage + exit + ;; + /*) DOCUMENT="$1" + ;; + *) DOCUMENT="$PWD/$1" + ;; + esac + shift +else + while [ -n "$1" ] ; do if [ -z "$2" ] ; then usage - exit -1 + exit 1 fi case "$1" in --help) @@ -76,7 +88,8 @@ while [ -n "$1" ] ; do ;; esac shift -done + done +fi # do not crash on dbus errors export DBUS_FATAL_WARNINGS=0 @@ -84,11 +97,9 @@ export DBUS_FATAL_WARNINGS=0 # make Compose input methods work [ -z "$LC_ALL" ] && export LC_ALL="$LANG" -# if pulseaudio is running, use it. Otherwise fall back to ALSA +# if pulseaudio is running, use it. if pulseaudio --check 2>/dev/null ; then VMOPTIONS="$VMOPTIONS -vm-sound-pulse" -else - VMOPTIONS="$VMOPTIONS -vm-sound-ALSA" fi # VM, Image, and Document are non-optional