+# 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 [OPTIONS] -o target.iso source1.iso [source2.iso ...]"
+ echo >&2 "
+Options:
+ -b Boot Params Additional boot parameters passed to grml2usb
+ -c Directory Copy files from directory to generated iso
+ -f Force overwrite of existing target.iso
+ -r BootParam Remove specified boot params.
+ Could be specfied multiple times.
+"
+ [ -n "$1" ] && exit $1 || exit 1
+ }
+# }}}
+
+# command line handling {{{
+ [[ $# -gt 2 ]] || usage 1
+
+ ISOFILE=''
+ DIR=''
+ ADD_OPTS=''
+ FORCE=''
+ typeset -a REMOVE_OPTS
+ while getopts fb:c:o:r: name; do
+ case $name in
+ o) ISOFILE="$OPTARG";;
+ b) ADD_OPTS="--bootoption="$OPTARG"";;
+ c) DIR="$OPTARG";;
+ f) FORCE='true';;
+ r) REMOVE_OPTS+=(--remove-bootoption="$OPTARG");;
+ ?) usage 2;;
+ esac
+ done