From: Michael Prokop Date: Fri, 27 Jul 2012 12:43:40 +0000 (+0200) Subject: Do not accept any command line arguments we can't handle X-Git-Tag: v0.19.6~3 X-Git-Url: http://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=644f7bd9efceda1d9bb4c0985b02c3a98241844c Do not accept any command line arguments we can't handle When executing something like: | grml-live [...] -V B -q this doesn't skip the mksquashfs stage (and neither the chroot build stage of course) because the "B" can't be processed for obvious reasons. The user mistyped the "-B" here, but then we shouldn't even try to execute the command line, so just exit in such a case. --- diff --git a/grml-live b/grml-live index 3964cbd..0aed77e 100755 --- a/grml-live +++ b/grml-live @@ -337,6 +337,11 @@ while getopts "a:C:c:d:D:e:g:i:I:o:r:s:t:U:v:AbBFhnNqQuVz" opt; do esac done shift $(($OPTIND - 1)) # set ARGV to the first not parsed commandline parameter + +if [ -n "$1" ] ; then + echo "Error: unknown argument '$1' in options. Exiting to avoid possible data loss." >&2 + bailout 1 +fi # }}} # read local (non-packaged) configuration {{{