mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-20 22:48:22 +00:00
added getopt like error for missing option parameters
This commit is contained in:
1 parent
8f33d5549f
commit
b02c7c8fb5
8 files changed
+120
-30
No files matched your search
@@ -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=//'` ;;
|
||||
|
||||
|
||||
Reference in new issue
Block a user