summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-05-14 03:21:13 +0000
committerdteske <dteske@FreeBSD.org>2013-05-14 03:21:13 +0000
commit7c4460149dcf39ce45a63a428447da0574a29ddf (patch)
tree3e3774586a73d5c2921a5c3209867c7f40baf2a1
parentcc1a3599913049d157572c1dac7420d275fa208a (diff)
downloadFreeBSD-src-7c4460149dcf39ce45a63a428447da0574a29ddf.zip
FreeBSD-src-7c4460149dcf39ce45a63a428447da0574a29ddf.tar.gz
Centralize standard getopts arguments, both for convenience and to correct
a bug in which certain combinations of arguments produced unexpected results such as `-dX' (now properly produces debugging and X11), `-XS' (now properly produces X11 in secure mode), `-df-' (enables debugging when reading a script from standard-input, etc. Multi-word variations such as `-d -X', `-X -S', `-d -f-', `-d -f -', etc. also work as expected. Also tested were variations in argument order, which are now working as expected.
-rwxr-xr-xusr.sbin/bsdconfig/bsdconfig2
-rwxr-xr-xusr.sbin/bsdconfig/console/console2
-rwxr-xr-xusr.sbin/bsdconfig/console/font2
-rwxr-xr-xusr.sbin/bsdconfig/console/keymap2
-rwxr-xr-xusr.sbin/bsdconfig/console/repeat2
-rwxr-xr-xusr.sbin/bsdconfig/console/saver2
-rwxr-xr-xusr.sbin/bsdconfig/console/screenmap2
-rwxr-xr-xusr.sbin/bsdconfig/console/ttys2
-rwxr-xr-xusr.sbin/bsdconfig/diskmgmt/diskmgmt2
-rwxr-xr-xusr.sbin/bsdconfig/docsinstall/docsinstall2
-rwxr-xr-xusr.sbin/bsdconfig/mouse/disable2
-rwxr-xr-xusr.sbin/bsdconfig/mouse/enable2
-rwxr-xr-xusr.sbin/bsdconfig/mouse/flags2
-rwxr-xr-xusr.sbin/bsdconfig/mouse/mouse2
-rwxr-xr-xusr.sbin/bsdconfig/mouse/port2
-rwxr-xr-xusr.sbin/bsdconfig/mouse/type2
-rwxr-xr-xusr.sbin/bsdconfig/networking/defaultrouter2
-rwxr-xr-xusr.sbin/bsdconfig/networking/devices2
-rwxr-xr-xusr.sbin/bsdconfig/networking/hostname2
-rwxr-xr-xusr.sbin/bsdconfig/networking/nameservers2
-rwxr-xr-xusr.sbin/bsdconfig/networking/networking2
-rwxr-xr-xusr.sbin/bsdconfig/packages/packages2
-rwxr-xr-xusr.sbin/bsdconfig/password/password2
-rwxr-xr-xusr.sbin/bsdconfig/security/kern_securelevel2
-rwxr-xr-xusr.sbin/bsdconfig/security/security2
-rw-r--r--usr.sbin/bsdconfig/share/common.subr16
-rw-r--r--usr.sbin/bsdconfig/share/dialog.subr20
-rwxr-xr-xusr.sbin/bsdconfig/startup/misc2
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcadd2
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcconf2
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcdelete2
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcedit2
-rwxr-xr-xusr.sbin/bsdconfig/startup/rcvar2
-rwxr-xr-xusr.sbin/bsdconfig/startup/startup2
-rwxr-xr-xusr.sbin/bsdconfig/timezone/timezone2
-rwxr-xr-xusr.sbin/bsdconfig/ttys/ttys2
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/groupadd2
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/groupdel2
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/groupedit2
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/useradd2
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/userdel2
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/useredit2
-rwxr-xr-xusr.sbin/bsdconfig/usermgmt/usermgmt2
43 files changed, 72 insertions, 46 deletions
diff --git a/usr.sbin/bsdconfig/bsdconfig b/usr.sbin/bsdconfig/bsdconfig
index 419d79f..90fcf86 100755
--- a/usr.sbin/bsdconfig/bsdconfig
+++ b/usr.sbin/bsdconfig/bsdconfig
@@ -239,7 +239,7 @@ fi
# Process command-line arguments
#
scripts_loaded=0
-while getopts dD:f:hSX flag; do
+while getopts f:h$GETOPTS_STDARGS flag; do
case "$flag" in
f) [ $scripts_loaded -eq 0 ] && f_include $BSDCFG_SHARE/script.subr
f_script_load "$OPTARG"
diff --git a/usr.sbin/bsdconfig/console/console b/usr.sbin/bsdconfig/console/console
index e2387f5..e4d978c 100755
--- a/usr.sbin/bsdconfig/console/console
+++ b/usr.sbin/bsdconfig/console/console
@@ -95,7 +95,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/console/font b/usr.sbin/bsdconfig/console/font
index 9363ffd..57af2e8 100755
--- a/usr.sbin/bsdconfig/console/font
+++ b/usr.sbin/bsdconfig/console/font
@@ -119,7 +119,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/console/keymap b/usr.sbin/bsdconfig/console/keymap
index e343db9..e5f6462 100755
--- a/usr.sbin/bsdconfig/console/keymap
+++ b/usr.sbin/bsdconfig/console/keymap
@@ -217,7 +217,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/console/repeat b/usr.sbin/bsdconfig/console/repeat
index b426d36..5447315 100755
--- a/usr.sbin/bsdconfig/console/repeat
+++ b/usr.sbin/bsdconfig/console/repeat
@@ -99,7 +99,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/console/saver b/usr.sbin/bsdconfig/console/saver
index bea046e..fa3bffe 100755
--- a/usr.sbin/bsdconfig/console/saver
+++ b/usr.sbin/bsdconfig/console/saver
@@ -118,7 +118,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/console/screenmap b/usr.sbin/bsdconfig/console/screenmap
index 17de356..643e671 100755
--- a/usr.sbin/bsdconfig/console/screenmap
+++ b/usr.sbin/bsdconfig/console/screenmap
@@ -103,7 +103,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/console/ttys b/usr.sbin/bsdconfig/console/ttys
index ad7a9c4..77d5f1b 100755
--- a/usr.sbin/bsdconfig/console/ttys
+++ b/usr.sbin/bsdconfig/console/ttys
@@ -163,7 +163,7 @@ ttys_set_type()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/diskmgmt/diskmgmt b/usr.sbin/bsdconfig/diskmgmt/diskmgmt
index b8b97dc..26d39be 100755
--- a/usr.sbin/bsdconfig/diskmgmt/diskmgmt
+++ b/usr.sbin/bsdconfig/diskmgmt/diskmgmt
@@ -56,7 +56,7 @@ X11TERM_OPTS=
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/docsinstall/docsinstall b/usr.sbin/bsdconfig/docsinstall/docsinstall
index 141bc7f..4163a4c 100755
--- a/usr.sbin/bsdconfig/docsinstall/docsinstall
+++ b/usr.sbin/bsdconfig/docsinstall/docsinstall
@@ -56,7 +56,7 @@ X11TERM_OPTS=
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/mouse/disable b/usr.sbin/bsdconfig/mouse/disable
index 2a2cfb4..89ec176 100755
--- a/usr.sbin/bsdconfig/mouse/disable
+++ b/usr.sbin/bsdconfig/mouse/disable
@@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/mouse/enable b/usr.sbin/bsdconfig/mouse/enable
index 43abac5..d33f119 100755
--- a/usr.sbin/bsdconfig/mouse/enable
+++ b/usr.sbin/bsdconfig/mouse/enable
@@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/mouse/flags b/usr.sbin/bsdconfig/mouse/flags
index 0705139..d6f50e8 100755
--- a/usr.sbin/bsdconfig/mouse/flags
+++ b/usr.sbin/bsdconfig/mouse/flags
@@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/mouse/mouse b/usr.sbin/bsdconfig/mouse/mouse
index b1bd9d9..7c333c8 100755
--- a/usr.sbin/bsdconfig/mouse/mouse
+++ b/usr.sbin/bsdconfig/mouse/mouse
@@ -94,7 +94,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/mouse/port b/usr.sbin/bsdconfig/mouse/port
index cb40652..c0bc61e 100755
--- a/usr.sbin/bsdconfig/mouse/port
+++ b/usr.sbin/bsdconfig/mouse/port
@@ -103,7 +103,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/mouse/type b/usr.sbin/bsdconfig/mouse/type
index f76e931..92745c6 100755
--- a/usr.sbin/bsdconfig/mouse/type
+++ b/usr.sbin/bsdconfig/mouse/type
@@ -111,7 +111,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/networking/defaultrouter b/usr.sbin/bsdconfig/networking/defaultrouter
index cc43f85..5b8ebdc 100755
--- a/usr.sbin/bsdconfig/networking/defaultrouter
+++ b/usr.sbin/bsdconfig/networking/defaultrouter
@@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/networking/devices b/usr.sbin/bsdconfig/networking/devices
index ae3136c..11614f0 100755
--- a/usr.sbin/bsdconfig/networking/devices
+++ b/usr.sbin/bsdconfig/networking/devices
@@ -54,7 +54,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line options
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/networking/hostname b/usr.sbin/bsdconfig/networking/hostname
index 4029d3c..55cc438 100755
--- a/usr.sbin/bsdconfig/networking/hostname
+++ b/usr.sbin/bsdconfig/networking/hostname
@@ -52,7 +52,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/networking/nameservers b/usr.sbin/bsdconfig/networking/nameservers
index aeda09e..d1b8123 100755
--- a/usr.sbin/bsdconfig/networking/nameservers
+++ b/usr.sbin/bsdconfig/networking/nameservers
@@ -52,7 +52,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/networking/networking b/usr.sbin/bsdconfig/networking/networking
index 3697f31..8c9468d 100755
--- a/usr.sbin/bsdconfig/networking/networking
+++ b/usr.sbin/bsdconfig/networking/networking
@@ -91,7 +91,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/packages/packages b/usr.sbin/bsdconfig/packages/packages
index 3e62343..8c8ccc1 100755
--- a/usr.sbin/bsdconfig/packages/packages
+++ b/usr.sbin/bsdconfig/packages/packages
@@ -55,7 +55,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/password/password b/usr.sbin/bsdconfig/password/password
index f63e455..e7c3180 100755
--- a/usr.sbin/bsdconfig/password/password
+++ b/usr.sbin/bsdconfig/password/password
@@ -55,7 +55,7 @@ USER_ROOT=root
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/security/kern_securelevel b/usr.sbin/bsdconfig/security/kern_securelevel
index 61ad9bf..ca71a1e 100755
--- a/usr.sbin/bsdconfig/security/kern_securelevel
+++ b/usr.sbin/bsdconfig/security/kern_securelevel
@@ -108,7 +108,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/security/security b/usr.sbin/bsdconfig/security/security
index ba9f9e2..36a8aae 100755
--- a/usr.sbin/bsdconfig/security/security
+++ b/usr.sbin/bsdconfig/security/security
@@ -133,7 +133,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr
index d92592c..88594b5 100644
--- a/usr.sbin/bsdconfig/share/common.subr
+++ b/usr.sbin/bsdconfig/share/common.subr
@@ -67,6 +67,16 @@ export UNAME_R="$(uname -r)" # Release Level (i.e. X.Y-RELEASE)
#
: ${DEBUG_SELF_INITIALIZE=1}
+#
+# Define standard optstring arguments that should be supported by all programs
+# using this include (unless DEBUG_SELF_INITIALIZE is set to NULL to prevent
+# f_debug_init() from autamatically processing "$@" for the below arguments):
+#
+# d Sets $debug to 1
+# D: Sets $debugFile to $OPTARG
+#
+GETOPTS_STDARGS="dD:"
+
############################################################ FUNCTIONS
# f_dprintf $fmt [ $opts ... ]
@@ -102,7 +112,9 @@ f_debug_init()
#
set -- $ARGV
local OPTIND
- while getopts dD: flag > /dev/null; do
+ f_dprintf "f_debug_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \
+ "$ARGV" "$GETOPTS_STDARGS"
+ while getopts "$GETOPTS_STDARGS" flag > /dev/null; do
case "$flag" in
d) debug=1;;
D) debugFile="$OPTARG";;
@@ -110,6 +122,8 @@ f_debug_init()
esac
done
shift $(( $OPTIND - 1 ))
+ f_dprintf "f_debug_init: debug=[%s] debugFile=[%s]" \
+ "$debug" "$debugFile"
#
# Automagically enable debugging if debugFile is set (and non-NULL)
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index 0f3187d..294dbf0 100644
--- a/usr.sbin/bsdconfig/share/dialog.subr
+++ b/usr.sbin/bsdconfig/share/dialog.subr
@@ -1531,24 +1531,36 @@ f_dialog_init()
eval exec $DIALOG_TERMINAL_PASSTHRU_FD\>\&1
#
+ # Add `-S' and `-X' to the list of standard arguments supported by all
+ #
+ case "$GETOPTS_STDARGS" in
+ *SX*) : good ;; # already present
+ *) GETOPTS_STDARGS="${GETOPTS_STDARGS}SX"
+ esac
+
+ #
# Process stored command-line arguments
#
- SECURE=$( set -- "$ARGV"
- while getopts S flag > /dev/null; do
+ f_dprintf "f_dialog_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \
+ "$ARGV" "$GETOPTS_STDARGS"
+ SECURE=$( set -- $ARGV
+ while getopts "$GETOPTS_STDARGS" flag > /dev/null; do
case "$flag" in
S) echo 1;;
\?) continue;;
esac
done
)
- USE_XDIALOG=$( set -- "$ARGV"
- while getopts SX flag > /dev/null; do
+ USE_XDIALOG=$( set -- $ARGV
+ while getopts $GETOPTS_STDARGS flag > /dev/null; do
case "$flag" in
S|X) echo 1;;
\?) continue;;
esac
done
)
+ f_dprintf "f_dialog_init: SECURE=[%s] USE_XDIALOG=[%s]" \
+ "$SECURE" "$USE_XDIALOG"
#
# Process `-X' command-line option
diff --git a/usr.sbin/bsdconfig/startup/misc b/usr.sbin/bsdconfig/startup/misc
index f0b5fb0..53ae2b0 100755
--- a/usr.sbin/bsdconfig/startup/misc
+++ b/usr.sbin/bsdconfig/startup/misc
@@ -319,7 +319,7 @@ dialog_input_value()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/startup/rcadd b/usr.sbin/bsdconfig/startup/rcadd
index a3c7724..3a4fbaa 100755
--- a/usr.sbin/bsdconfig/startup/rcadd
+++ b/usr.sbin/bsdconfig/startup/rcadd
@@ -97,7 +97,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/startup/rcconf b/usr.sbin/bsdconfig/startup/rcconf
index 45316d7..4d47ea1 100755
--- a/usr.sbin/bsdconfig/startup/rcconf
+++ b/usr.sbin/bsdconfig/startup/rcconf
@@ -201,7 +201,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/startup/rcdelete b/usr.sbin/bsdconfig/startup/rcdelete
index 7018774..5a8b211 100755
--- a/usr.sbin/bsdconfig/startup/rcdelete
+++ b/usr.sbin/bsdconfig/startup/rcdelete
@@ -301,7 +301,7 @@ dialog_menu_confirm_delete()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/startup/rcedit b/usr.sbin/bsdconfig/startup/rcedit
index b97211f..4dea4dc 100755
--- a/usr.sbin/bsdconfig/startup/rcedit
+++ b/usr.sbin/bsdconfig/startup/rcedit
@@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/startup/rcvar b/usr.sbin/bsdconfig/startup/rcvar
index d0268b8..e82a35b 100755
--- a/usr.sbin/bsdconfig/startup/rcvar
+++ b/usr.sbin/bsdconfig/startup/rcvar
@@ -161,7 +161,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/startup/startup b/usr.sbin/bsdconfig/startup/startup
index 45375fe..11eb9a1 100755
--- a/usr.sbin/bsdconfig/startup/startup
+++ b/usr.sbin/bsdconfig/startup/startup
@@ -92,7 +92,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/timezone/timezone b/usr.sbin/bsdconfig/timezone/timezone
index 62dc7f7..226eef7 100755
--- a/usr.sbin/bsdconfig/timezone/timezone
+++ b/usr.sbin/bsdconfig/timezone/timezone
@@ -117,7 +117,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts C:dD:ehnrsSvX flag; do
+while getopts C:ehnrsv$GETOPTS_STDARGS flag; do
case "$flag" in
C) CHROOTENV="$OPTARG";;
e) TZ_OR_FAIL=1;;
diff --git a/usr.sbin/bsdconfig/ttys/ttys b/usr.sbin/bsdconfig/ttys/ttys
index f0c7c2a..64d776c 100755
--- a/usr.sbin/bsdconfig/ttys/ttys
+++ b/usr.sbin/bsdconfig/ttys/ttys
@@ -67,7 +67,7 @@ ETC_TTYS=/etc/ttys
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/usermgmt/groupadd b/usr.sbin/bsdconfig/usermgmt/groupadd
index b9bfce8..0eed353 100755
--- a/usr.sbin/bsdconfig/usermgmt/groupadd
+++ b/usr.sbin/bsdconfig/usermgmt/groupadd
@@ -47,7 +47,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/usermgmt/groupdel b/usr.sbin/bsdconfig/usermgmt/groupdel
index ff6b702..e5a759f 100755
--- a/usr.sbin/bsdconfig/usermgmt/groupdel
+++ b/usr.sbin/bsdconfig/usermgmt/groupdel
@@ -50,7 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/usermgmt/groupedit b/usr.sbin/bsdconfig/usermgmt/groupedit
index 7cd70c6..ba249c3 100755
--- a/usr.sbin/bsdconfig/usermgmt/groupedit
+++ b/usr.sbin/bsdconfig/usermgmt/groupedit
@@ -50,7 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/usermgmt/useradd b/usr.sbin/bsdconfig/usermgmt/useradd
index 1dbf0cd..113caaa 100755
--- a/usr.sbin/bsdconfig/usermgmt/useradd
+++ b/usr.sbin/bsdconfig/usermgmt/useradd
@@ -47,7 +47,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/usermgmt/userdel b/usr.sbin/bsdconfig/usermgmt/userdel
index 3847a1a..05b160f 100755
--- a/usr.sbin/bsdconfig/usermgmt/userdel
+++ b/usr.sbin/bsdconfig/usermgmt/userdel
@@ -50,7 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/usermgmt/useredit b/usr.sbin/bsdconfig/usermgmt/useredit
index 60e1476..60a3377 100755
--- a/usr.sbin/bsdconfig/usermgmt/useredit
+++ b/usr.sbin/bsdconfig/usermgmt/useredit
@@ -50,7 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" )
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
diff --git a/usr.sbin/bsdconfig/usermgmt/usermgmt b/usr.sbin/bsdconfig/usermgmt/usermgmt
index 3c5a5ef..06144e1 100755
--- a/usr.sbin/bsdconfig/usermgmt/usermgmt
+++ b/usr.sbin/bsdconfig/usermgmt/usermgmt
@@ -111,7 +111,7 @@ dialog_menu_main()
#
# Process command-line arguments
#
-while getopts dD:hSX flag; do
+while getopts h$GETOPTS_STDARGS flag; do
case "$flag" in
h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";;
esac
OpenPOWER on IntegriCloud