-# define function getfilesize before "set -e"
-if stat --help >/dev/null 2>&1; then
- getfilesize='stat -c %s' # GNU stat
-else
- getfilesize='stat -f %z' # BSD stat
-fi
+# define function getfilesize before "set -e" {{{
+ if stat --help >/dev/null 2>&1; then
+ getfilesize='stat -c %s' # GNU stat
+ else
+ getfilesize='stat -f %z' # BSD stat
+ fi
+# }}}
+
+# adjust variables if necessary through environment {{{
+# path to the grml2usb script you'd like to use
+ [ -n "$GRML2USB" ] || GRML2USB='grml2usb'
+# work directory for creating the filesystem
+ [ -n "$WRKDIR" ] || WRKDIR='/tmp/grml2iso.tmp'
+# }}}
+
+# helper stuff {{{
+ set -e
+
+ usage() {
+ echo >&2 "Usage: $0 -o target.iso source1.iso [source2.iso ...]"
+ [ -n "$1" ] && exit $1 || exit 1
+ }
+# }}}
+
+# command line handling {{{
+ [[ $# -gt 2 ]] || usage 1
+
+ ISOFILE=''
+ while getopts ao: name; do
+ case $name in
+ o) ISOFILE="$OPTARG";;
+ ?) usage 2;;
+ esac
+ done