Skip to content

Commit

Permalink
Do not accept any command line arguments we can't handle
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mika committed Jul 27, 2012
1 parent 1584694 commit 644f7bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions grml-live
Original file line number Diff line number Diff line change
Expand Up @@ -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 {{{
Expand Down

0 comments on commit 644f7bd

Please sign in to comment.