Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163543001
D44673.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D44673.id.diff
View Options
diff --git a/usr.sbin/bsdinstall/bsdinstall b/usr.sbin/bsdinstall/bsdinstall
--- a/usr.sbin/bsdinstall/bsdinstall
+++ b/usr.sbin/bsdinstall/bsdinstall
@@ -34,6 +34,21 @@
export DEBUG_SELF_INITIALIZE=
export DEBUG_INITIALIZE_FILE=
+# When common.subr is included, it automatically scans "$@" for `-d' and/or
+# `-D file' arguments to conditionally enable debugging. Similarly, when
+# dialog.subr is included, it automatically scans "$@" for `-X' and/or `-S'.
+# To prevent this scanning from becoming confused by extra options, define
+# any/all extra arguments to use in the optstring to getopts when scanning
+# for dedicated options such as those described.
+#
+# NOTE: This needs to be declared before including `common.subr'.
+# NOTE: You really only need to list flags that require an argument as unknown
+# flags are silently accepted unless they take an argument (in which case
+# the following argument will terminate option processing unless it looks
+# like a flag).
+#
+GETOPTS_EXTRA=
+
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
@@ -49,13 +64,28 @@
export debugFile="${debugFile-${BSDINSTALL_LOG-${TMPDIR}/bsdinstall_log}}"
+############################################################ USAGE
+
+usage()
+{
+ echo "Usage: bsdinstall [-$GETOPTS_EXTRA$GETOPTS_STDARGS][target][...]" 1>&2
+ echo " -d Enable debugging output" 1>&2
+ echo " -D Save debugging output to a file" 1>&2
+ return 1
+}
+
############################################################ MAIN
#
# Process command-line arguments
#
-while getopts $GETOPTS_STDARGS ignored; do
- : just skipping known flags
+while getopts "$GETOPTS_EXTRA$GETOPTS_STDARGS" name; do
+ case "$name" in
+ '?')
+ usage
+ exit $?
+ ;;
+ esac
done
shift $(( $OPTIND - 1 ))
diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail
--- a/usr.sbin/bsdinstall/scripts/jail
+++ b/usr.sbin/bsdinstall/scripts/jail
@@ -54,6 +54,14 @@
fi
}
+#
+# Process command-line arguments
+#
+while getopts $GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS flag; do
+ :
+done
+shift $(( $OPTIND - 1 ))
+
if [ -z "$1" ]; then
error "Directory can not be empty\n\nUsage:\nbsdinstall jail directory"
fi
diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig
--- a/usr.sbin/bsdinstall/scripts/netconfig
+++ b/usr.sbin/bsdinstall/scripts/netconfig
@@ -44,6 +44,14 @@
: ${BSDDIALOG_ERROR=255}
: ${DIALOG="bsddialog"}
+#
+# Process command-line arguments
+#
+while getopts $GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS flag; do
+ :
+done
+shift $(( $OPTIND - 1 ))
+
for IF in `ifconfig -l`; do
test "$IF" = "lo0" && continue
(ifconfig -g wlan | egrep -wq $IF) && continue
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv4
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4
@@ -38,6 +38,14 @@
: ${BSDDIALOG_OK=0}
: ${BSDDIALOG_CANCEL=1}
+#
+# Process command-line arguments
+#
+while getopts $GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS flag; do
+ :
+done
+shift $(( $OPTIND - 1 ))
+
INTERFACE=$1
IFCONFIG_PREFIX="$2"
AUTO="${3:-}"
diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
--- a/usr.sbin/bsdinstall/scripts/netconfig_ipv6
+++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6
@@ -47,6 +47,14 @@
# - Add DHCPv6 support once FreeBSD ships with it.
#
+#
+# Process command-line arguments
+#
+while getopts $GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS flag; do
+ :
+done
+shift $(( $OPTIND - 1 ))
+
INTERFACE=$1
AUTO="${2:-}"
case "${INTERFACE}" in
diff --git a/usr.sbin/bsdinstall/scripts/script b/usr.sbin/bsdinstall/scripts/script
--- a/usr.sbin/bsdinstall/scripts/script
+++ b/usr.sbin/bsdinstall/scripts/script
@@ -82,6 +82,14 @@
set -e
trap error EXIT
+#
+# Process command-line arguments
+#
+while getopts $GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS flag; do
+ :
+done
+shift $(( $OPTIND - 1 ))
+
SCRIPT="$1"
shift
diff --git a/usr.sbin/bsdinstall/scripts/wlanconfig b/usr.sbin/bsdinstall/scripts/wlanconfig
--- a/usr.sbin/bsdinstall/scripts/wlanconfig
+++ b/usr.sbin/bsdinstall/scripts/wlanconfig
@@ -148,6 +148,14 @@
############################################################ MAIN
+#
+# Process command-line arguments
+#
+while getopts $GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS flag; do
+ :
+done
+shift $(( $OPTIND - 1 ))
+
: > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 25, 7:43 AM (14 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35467366
Default Alt Text
D44673.id.diff (4 KB)
Attached To
Mode
D44673: bsdinstall: handle command-line options in targets
Attached
Detach File
Event Timeline
Log In to Comment