added getopt like error for missing option parameters
This commit is contained in:
parent
8f33d5549f
commit
b02c7c8fb5
8 changed files with 120 additions and 30 deletions
|
@ -52,6 +52,17 @@ Report bugs to <bug-grub@gnu.org>.
|
|||
EOF
|
||||
}
|
||||
|
||||
argument () {
|
||||
opt=$1
|
||||
shift
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo "$0: option requires an argument -- '$opt'" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
echo $1
|
||||
}
|
||||
|
||||
input_dir=${pkglibdir}
|
||||
|
||||
# Check the arguments.
|
||||
|
@ -69,17 +80,17 @@ do
|
|||
exit 0 ;;
|
||||
|
||||
--modules)
|
||||
modules=$1; shift ;;
|
||||
modules=`argument $option "$@"`; shift ;;
|
||||
--modules=*)
|
||||
modules=`echo "$option" | sed 's/--modules=//'` ;;
|
||||
|
||||
--pkglibdir)
|
||||
input_dir=$1; shift ;;
|
||||
input_dir=`argument $option "$@"`; shift ;;
|
||||
--pkglibdir=*)
|
||||
input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;;
|
||||
|
||||
--grub-mkimage)
|
||||
grub_mkimage=$1; shift ;;
|
||||
grub_mkimage=`argument $option "$@"`; shift ;;
|
||||
--grub-mkimage=*)
|
||||
grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue