#!/bin/sh # Help function ############### help () { cat <= 2 +Yn Size of n-1 youngest generations, megabytes +An Size of tenured and semi-spaces, megabytes +Xn Code heap size, megabytes EOF exit 0 } # Default values ################ BINARY_PATH='/usr/lib/factor' RESOURCE_PATH='/usr/share/factor' IMAGE="$BINARY_PATH/basic.image" RUNTIME="$BINARY_PATH/runtime" # Logic ####### if test 0 -eq $# then # As a 'quick start' behaviour, so that new users can # get something to play with immediately. echo "Launching the Factor runtime with a read-only basic image." echo "Use \`\"filename\" save-image' to write an editable image." exec "$RUNTIME" "$IMAGE" -resource-path="$RESOURCE_PATH" else case "$1" in -h|--help) help ;; -b|--basic) IMAGE="$BINARY_PATH/basic.image" ;; -e|--extended) IMAGE="$BINARY_PATH/extended.image" ;; *) IMAGE="$1" ;; esac shift exec "$RUNTIME" "$IMAGE" -resource-path="$RESOURCE_PATH" "$@" fi