mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-29 16:44:03 +00:00
Revert previous change, "getopts" (with an 's') is a builtin in
/bin/sh.
This commit is contained in:
parent
b1c4c13da3
commit
52488123f3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154498
@ -8,46 +8,31 @@
|
|||||||
delete="NO"
|
delete="NO"
|
||||||
force="NO"
|
force="NO"
|
||||||
nextboot_file="/boot/nextboot.conf"
|
nextboot_file="/boot/nextboot.conf"
|
||||||
kernel=""
|
|
||||||
|
|
||||||
display_usage() {
|
display_usage() {
|
||||||
echo "Usage: nextboot [-f] [-o options] -k kernel"
|
echo "Usage: nextboot [-f] [-o options] -k kernel"
|
||||||
echo " nextboot -D"
|
echo " nextboot -D"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Parse args, do not use getopt because we don't want to rely on /usr
|
while getopts "Dfk:o:" argument ; do
|
||||||
while test $# -gt 0; do
|
case "${argument}" in
|
||||||
case $1 in
|
D)
|
||||||
-D)
|
|
||||||
delete="YES"
|
delete="YES"
|
||||||
;;
|
;;
|
||||||
-f)
|
f)
|
||||||
force="YES"
|
force="YES"
|
||||||
;;
|
;;
|
||||||
-k)
|
k)
|
||||||
if test $# -lt 2; then
|
kernel="${OPTARG}"
|
||||||
echo "$0: option $1 must specify kernel"
|
|
||||||
display_usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
kernel="$2"
|
|
||||||
shift
|
|
||||||
;;
|
;;
|
||||||
-o)
|
o)
|
||||||
if test $# -lt 2; then
|
kernel_options="${OPTARG}"
|
||||||
echo "$0: option $1 must specify boot options"
|
|
||||||
display_usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
kernel_options="$2"
|
|
||||||
shift
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
display_usage
|
display_usage
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ${delete} = "YES" ]; then
|
if [ ${delete} = "YES" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user