diff --git a/usr.sbin/bsdconfig/USAGE b/usr.sbin/bsdconfig/USAGE index eac7dbe41215..653933ec543e 100644 --- a/usr.sbin/bsdconfig/USAGE +++ b/usr.sbin/bsdconfig/USAGE @@ -31,10 +31,14 @@ Usage: @PROGRAM_NAME@ [OPTIONS] [command [OPTIONS]] OPTIONS: + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). -f file Load file as script and then exit. If multiple occurrences, program will only exit after last occurrence. If file is a single dash (`-'), @PROGRAM_NAME@ reads from standard input. - -h Print usage statement and exit. + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/bsdconfig b/usr.sbin/bsdconfig/bsdconfig index 07b73fef0b14..6ca788d8c87e 100755 --- a/usr.sbin/bsdconfig/bsdconfig +++ b/usr.sbin/bsdconfig/bsdconfig @@ -53,6 +53,7 @@ usage() local index="INDEX" cmd_list="" cd $BSDCFG_LIBE + # No need to preserve CWD (headed toward exit) # Test for language-specific indices f_quietly ls */"$index.${LANG:-$LC_ALL}" && @@ -131,6 +132,8 @@ usage() f_usage $BSDCFG_LIBE/USAGE \ "PROGRAM_NAME" "$pgm" \ "COMMAND_LIST" "$cmd_list" + + # Never reached } # dialog_menu_main @@ -152,14 +155,14 @@ dialog_menu_main() local sanitize_awk="{ gsub(/'/, \"'\\\\''\"); print }" local menuitem menu_title menu_help menu_selection index=2 - for menuitem in $( ls -d [0-9][0-9][0-9].* ); do + for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do [ $index -lt ${#DIALOG_MENU_TAGS} ] || break tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) menu_program= menu_title= menu_help= - f_include_lang $menuitem/INDEX + f_include_lang $BSDCFG_LIBE/$menuitem/INDEX [ "$menu_program" ] || continue case "$menu_program" in @@ -231,7 +234,7 @@ fi # Process command-line arguments # scripts_loaded=0 -while getopts f:hSX flag; do +while getopts dD:f:hSX flag; do case "$flag" in f) [ $scripts_loaded -eq 0 ] && f_include $BSDCFG_SHARE/script.subr f_script_load "$OPTARG" @@ -254,8 +257,6 @@ f_dialog_title "$msg_main_menu" # Incorporate rc-file if it exists [ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" -cd $BSDCFG_LIBE || f_die 1 "$msg_directory_not_found" "$BSDCFG_LIBE" - # # If a non-option argument was passed, process it as a menuitem selection... # diff --git a/usr.sbin/bsdconfig/console/USAGE b/usr.sbin/bsdconfig/console/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/console/USAGE +++ b/usr.sbin/bsdconfig/console/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/console/console b/usr.sbin/bsdconfig/console/console index 5f3b7afb814f..2352559ba3d5 100755 --- a/usr.sbin/bsdconfig/console/console +++ b/usr.sbin/bsdconfig/console/console @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 022952f962ba..763a94c892a3 100755 --- a/usr.sbin/bsdconfig/console/font +++ b/usr.sbin/bsdconfig/console/font @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -101,7 +101,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 5518140b980c..f10b79e3ceb8 100755 --- a/usr.sbin/bsdconfig/console/keymap +++ b/usr.sbin/bsdconfig/console/keymap @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -141,7 +141,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 93357e841da3..face69e20b7d 100755 --- a/usr.sbin/bsdconfig/console/repeat +++ b/usr.sbin/bsdconfig/console/repeat @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -91,7 +91,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 4f6729b044e6..1036b20ded4d 100755 --- a/usr.sbin/bsdconfig/console/saver +++ b/usr.sbin/bsdconfig/console/saver @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -101,7 +101,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 5c5e29e0a19d..27ce53c6cd62 100755 --- a/usr.sbin/bsdconfig/console/screenmap +++ b/usr.sbin/bsdconfig/console/screenmap @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 3f9945e7ac88..e06a2a7cb661 100755 --- a/usr.sbin/bsdconfig/console/ttys +++ b/usr.sbin/bsdconfig/console/ttys @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -163,7 +163,7 @@ ttys_set_type() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac diff --git a/usr.sbin/bsdconfig/diskmgmt/USAGE b/usr.sbin/bsdconfig/diskmgmt/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/diskmgmt/USAGE +++ b/usr.sbin/bsdconfig/diskmgmt/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/diskmgmt/diskmgmt b/usr.sbin/bsdconfig/diskmgmt/diskmgmt index 27852fbc874f..b8b97dccbeb8 100755 --- a/usr.sbin/bsdconfig/diskmgmt/diskmgmt +++ b/usr.sbin/bsdconfig/diskmgmt/diskmgmt @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ X11TERM_OPTS= # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac diff --git a/usr.sbin/bsdconfig/docsinstall/USAGE b/usr.sbin/bsdconfig/docsinstall/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/docsinstall/USAGE +++ b/usr.sbin/bsdconfig/docsinstall/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/docsinstall/docsinstall b/usr.sbin/bsdconfig/docsinstall/docsinstall index 52e047945213..141bc7f4957c 100755 --- a/usr.sbin/bsdconfig/docsinstall/docsinstall +++ b/usr.sbin/bsdconfig/docsinstall/docsinstall @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ X11TERM_OPTS= # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac diff --git a/usr.sbin/bsdconfig/dot/USAGE b/usr.sbin/bsdconfig/dot/USAGE index c1c0dc3e3bf1..a1ccf73db0f3 100644 --- a/usr.sbin/bsdconfig/dot/USAGE +++ b/usr.sbin/bsdconfig/dot/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,7 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -h Print this usage statement and exit. -c Don't show command-line shortcut relationships. -d Don't show the date in the graph label. -i Don't show include relationships. diff --git a/usr.sbin/bsdconfig/dot/dot b/usr.sbin/bsdconfig/dot/dot index 2cc659c7676d..cbe9ad504d30 100755 --- a/usr.sbin/bsdconfig/dot/dot +++ b/usr.sbin/bsdconfig/dot/dot @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -28,6 +28,11 @@ # ############################################################ INCLUDES +# Prevent common.subr from auto initializing debugging (this is not an inter- +# active utility that requires debugging; also `-d' has been repurposed). +# +DEBUG_SELF_INITIALIZE=NO + BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." "$0" diff --git a/usr.sbin/bsdconfig/mouse/USAGE b/usr.sbin/bsdconfig/mouse/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/mouse/USAGE +++ b/usr.sbin/bsdconfig/mouse/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/mouse/disable b/usr.sbin/bsdconfig/mouse/disable index 0f41d73ee720..2a2cfb410220 100755 --- a/usr.sbin/bsdconfig/mouse/disable +++ b/usr.sbin/bsdconfig/mouse/disable @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 f40146142f27..43abac5798e2 100755 --- a/usr.sbin/bsdconfig/mouse/enable +++ b/usr.sbin/bsdconfig/mouse/enable @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 06218ac606ba..0705139af03c 100755 --- a/usr.sbin/bsdconfig/mouse/flags +++ b/usr.sbin/bsdconfig/mouse/flags @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -56,7 +56,7 @@ MOUSED_PIDFILE=/var/run/moused.pid # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 95d76771d6e0..e8ce3d03669c 100755 --- a/usr.sbin/bsdconfig/mouse/mouse +++ b/usr.sbin/bsdconfig/mouse/mouse @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -92,7 +92,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 87d4a0baf118..55c4eb72a6d3 100755 --- a/usr.sbin/bsdconfig/mouse/port +++ b/usr.sbin/bsdconfig/mouse/port @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -93,7 +93,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 ee9c4ed1b30d..0bd0e06451f1 100755 --- a/usr.sbin/bsdconfig/mouse/type +++ b/usr.sbin/bsdconfig/mouse/type @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -97,7 +97,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac diff --git a/usr.sbin/bsdconfig/networking/USAGE b/usr.sbin/bsdconfig/networking/USAGE index a4dd74c8048d..b8e2fea894bc 100644 --- a/usr.sbin/bsdconfig/networking/USAGE +++ b/usr.sbin/bsdconfig/networking/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/networking/defaultrouter b/usr.sbin/bsdconfig/networking/defaultrouter index 44e522eb19e2..cc43f852231f 100755 --- a/usr.sbin/bsdconfig/networking/defaultrouter +++ b/usr.sbin/bsdconfig/networking/defaultrouter @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 f9c27b497e66..dd1fb378f309 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 hSX flag; do +while getopts dD:hSX 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 231320ecc872..ab74ae69c417 100755 --- a/usr.sbin/bsdconfig/networking/hostname +++ b/usr.sbin/bsdconfig/networking/hostname @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 9ebebc8a97b8..1c2b7a0aec70 100755 --- a/usr.sbin/bsdconfig/networking/nameservers +++ b/usr.sbin/bsdconfig/networking/nameservers @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 8acfbdeafd6d..d3c8a8d506e3 100755 --- a/usr.sbin/bsdconfig/networking/networking +++ b/usr.sbin/bsdconfig/networking/networking @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -89,7 +89,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac diff --git a/usr.sbin/bsdconfig/password/USAGE b/usr.sbin/bsdconfig/password/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/password/USAGE +++ b/usr.sbin/bsdconfig/password/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/password/password b/usr.sbin/bsdconfig/password/password index 50d963dbada8..f63e455acb33 100755 --- a/usr.sbin/bsdconfig/password/password +++ b/usr.sbin/bsdconfig/password/password @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -55,7 +55,7 @@ USER_ROOT=root # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac diff --git a/usr.sbin/bsdconfig/security/USAGE b/usr.sbin/bsdconfig/security/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/security/USAGE +++ b/usr.sbin/bsdconfig/security/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/security/kern_securelevel b/usr.sbin/bsdconfig/security/kern_securelevel index 42594c669456..5307bcaaeba6 100755 --- a/usr.sbin/bsdconfig/security/kern_securelevel +++ b/usr.sbin/bsdconfig/security/kern_securelevel @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -97,7 +97,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 f503e5151aab..ff582ad0a1eb 100755 --- a/usr.sbin/bsdconfig/security/security +++ b/usr.sbin/bsdconfig/security/security @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -111,7 +111,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 cb9096fc3ce3..d1a3c009e33a 100644 --- a/usr.sbin/bsdconfig/share/common.subr +++ b/usr.sbin/bsdconfig/share/common.subr @@ -62,6 +62,11 @@ export UNAME_S="$(uname -s)" # Operating System (i.e. FreeBSD) export UNAME_P="$(uname -p)" # Processor Architecture (i.e. i386) export UNAME_R="$(uname -r)" # Release Level (i.e. X.Y-RELEASE) +# +# Default behavior is to call f_debug_init() automatically when loaded. +# +: ${DEBUG_SELF_INITIALIZE=1} + ############################################################ FUNCTIONS # f_dprintf $fmt [ $opts ... ] @@ -86,6 +91,59 @@ f_dprintf() return $SUCCESS } +# f_debug_init +# +# Initialize debugging. Truncates $debugFile to zero bytes if set. +# +f_debug_init() +{ + # + # Process stored command-line arguments + # + ( set -- "$ARGV" + while getopts d flag > /dev/null; do + case "$flag" in + d) true; exit;; + \?) continue;; + esac + done + false + ) && debug=1 + debugFile=$( set -- "$ARGV" + while getopts D flag > /dev/null; do + case "$flag" in + D) echo "$OPTARG";; + \?) continue;; + esac + done + ) + + # + # Make debugging persistant if set + # + [ "$debug" ] && export debug + + # + # Truncate the debug file upon. Note that we will trim a leading plus + # (`+') from the value of debugFile to support persistant meaning that + # f_dprintf() should print both to standard output and $debugFile + # (minus the leading plus, of course). + # + local _debug_file="${debugFile#+}" + if [ "$_debug_file" ]; then + if ( umask 022 && :> "$_debug_file" ); then + f_dprintf "Successfully initialized debugFile \`%s'" \ + "$_debug_file" + [ "${debug+set}" ] || + debug=1 # turn debugging on if not set + else + unset debugFile + f_dprintf "Unable to initialize debugFile \`%s'" \ + "$_debug_file" + fi + fi +} + # f_err $fmt [ $opts ... ] # # Print a message to stderr (fd=2). @@ -615,28 +673,14 @@ eval exec $TERMINAL_STDOUT_PASSTHRU\>\&1 eval exec $TERMINAL_STDERR_PASSTHRU\>\&2 # -# Make debugging persistant if set +# Self-initialize unless requested otherwise # -[ "$debug" ] && export debug - -# -# Truncate the debug file upon initialization (now). Note that we will trim a -# leading plus (`+') from the value of debugFile to support persistant meaning -# that f_dprintf() should print both to standard output and $debugFile (minus -# the leading plus, of course). -# -_debug_file="${debugFile#+}" -if [ "$_debug_file" ]; then - if ( umask 022 && :> "$_debug_file" ); then - f_dprintf "Successfully initialized debugFile \`%s'" \ - "$_debug_file" - else - unset debugFile - f_dprintf "Unable to initialize debugFile \`%s'" \ - "$_debug_file" - fi -fi -unset _debug_file +f_dprintf "%s: DEBUG_SELF_INITIALIZE=[%s]" \ + dialog.subr "$DEBUG_SELF_INITIALIZE" +case "$DEBUG_SELF_INITIALIZE" in +""|0|[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee]) : do nothing ;; +*) f_debug_init +esac # # Log our operating environment for debugging purposes diff --git a/usr.sbin/bsdconfig/share/mustberoot.subr b/usr.sbin/bsdconfig/share/mustberoot.subr index 2ead592842ac..ebfe812f1010 100644 --- a/usr.sbin/bsdconfig/share/mustberoot.subr +++ b/usr.sbin/bsdconfig/share/mustberoot.subr @@ -1,6 +1,6 @@ if [ ! "$_MUSTBEROOT_SUBR" ]; then _MUSTBEROOT_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -250,6 +250,7 @@ f_become_root_via_sudo() fi # Re-execute ourselves with sudo(8) + f_dprintf "%s: Becoming root via sudo(8)..." mustberoot.subr if [ $ARGC -gt 0 ]; then exec sudo "$0" $ARGV else diff --git a/usr.sbin/bsdconfig/startup/USAGE b/usr.sbin/bsdconfig/startup/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/startup/USAGE +++ b/usr.sbin/bsdconfig/startup/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/startup/misc b/usr.sbin/bsdconfig/startup/misc index 37bb80f63870..5a8c859384da 100755 --- a/usr.sbin/bsdconfig/startup/misc +++ b/usr.sbin/bsdconfig/startup/misc @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -276,7 +276,7 @@ dialog_input_value() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 3bea6703fbdc..02661497525a 100755 --- a/usr.sbin/bsdconfig/startup/rcadd +++ b/usr.sbin/bsdconfig/startup/rcadd @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -97,7 +97,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 d09874bba5a4..1fb01b077cd8 100755 --- a/usr.sbin/bsdconfig/startup/rcconf +++ b/usr.sbin/bsdconfig/startup/rcconf @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -196,7 +196,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 578b13e4ff05..3e21658c0859 100755 --- a/usr.sbin/bsdconfig/startup/rcdelete +++ b/usr.sbin/bsdconfig/startup/rcdelete @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -269,7 +269,7 @@ dialog_menu_delete() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 011436867883..b97211ffd98b 100755 --- a/usr.sbin/bsdconfig/startup/rcedit +++ b/usr.sbin/bsdconfig/startup/rcedit @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -49,7 +49,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 d655e613c091..5ac41ef60fd6 100755 --- a/usr.sbin/bsdconfig/startup/rcvar +++ b/usr.sbin/bsdconfig/startup/rcvar @@ -158,7 +158,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 c9229b711f26..331989ccdaed 100755 --- a/usr.sbin/bsdconfig/startup/startup +++ b/usr.sbin/bsdconfig/startup/startup @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -90,7 +90,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac diff --git a/usr.sbin/bsdconfig/timezone/USAGE b/usr.sbin/bsdconfig/timezone/USAGE index a88369cf2173..cdd7d9ab82ae 100644 --- a/usr.sbin/bsdconfig/timezone/USAGE +++ b/usr.sbin/bsdconfig/timezone/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,11 +26,15 @@ Usage: bsdconfig @PROGRAM_NAME@ [-ehnrSsvX] [-C chroot_dir] [zinfo_file | zinfo_name] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). -e Only return success on exit if user selects a timezone AND the selected timezone was successfully installed. By default (without this flag), success is always returned unless an error has occurred. + -h Print this usage statement and exit. -n Do not create or copy files. -r Reinstall the zoneinfo file installed last time. The name is obtained from /var/db/zoneinfo. diff --git a/usr.sbin/bsdconfig/timezone/timezone b/usr.sbin/bsdconfig/timezone/timezone index 5649b603d014..c23234469c2b 100755 --- a/usr.sbin/bsdconfig/timezone/timezone +++ b/usr.sbin/bsdconfig/timezone/timezone @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2011-2012 Devin Teske +# Copyright (c) 2011-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -115,7 +115,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts C:ehnrsSvX flag; do +while getopts C:dD:ehnrsSvX flag; do case "$flag" in C) CHROOTENV="$OPTARG";; e) TZ_OR_FAIL=1;; diff --git a/usr.sbin/bsdconfig/ttys/USAGE b/usr.sbin/bsdconfig/ttys/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/ttys/USAGE +++ b/usr.sbin/bsdconfig/ttys/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/ttys/ttys b/usr.sbin/bsdconfig/ttys/ttys index db7cb20934a7..f0c7c2a9014b 100755 --- a/usr.sbin/bsdconfig/ttys/ttys +++ b/usr.sbin/bsdconfig/ttys/ttys @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -67,7 +67,7 @@ ETC_TTYS=/etc/ttys # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac diff --git a/usr.sbin/bsdconfig/usermgmt/USAGE b/usr.sbin/bsdconfig/usermgmt/USAGE index 9aa4dca44928..db5a4732833e 100644 --- a/usr.sbin/bsdconfig/usermgmt/USAGE +++ b/usr.sbin/bsdconfig/usermgmt/USAGE @@ -1,4 +1,4 @@ -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without @@ -27,7 +27,11 @@ Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] OPTIONS: - -h Print usage statement and exit. + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. -S Secure X11 mode (implies `-X'). As root, always prompt-for and validate sudo(8) username/password before starting. -X Use Xdialog(1) in place of dialog(1). diff --git a/usr.sbin/bsdconfig/usermgmt/groupadd b/usr.sbin/bsdconfig/usermgmt/groupadd index 34962a92c576..b9bfce8bd386 100755 --- a/usr.sbin/bsdconfig/usermgmt/groupadd +++ b/usr.sbin/bsdconfig/usermgmt/groupadd @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 b51f00291f83..38fe311ec7c9 100755 --- a/usr.sbin/bsdconfig/usermgmt/groupdel +++ b/usr.sbin/bsdconfig/usermgmt/groupdel @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 c192c0f069ab..93036e11779b 100755 --- a/usr.sbin/bsdconfig/usermgmt/groupedit +++ b/usr.sbin/bsdconfig/usermgmt/groupedit @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 8a6972951337..1dbf0cd92e20 100755 --- a/usr.sbin/bsdconfig/usermgmt/useradd +++ b/usr.sbin/bsdconfig/usermgmt/useradd @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -47,7 +47,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 4a7e2bebe3f2..02f6e6532f4e 100755 --- a/usr.sbin/bsdconfig/usermgmt/userdel +++ b/usr.sbin/bsdconfig/usermgmt/userdel @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 67aba0794717..00e6ae5aa9d7 100755 --- a/usr.sbin/bsdconfig/usermgmt/useredit +++ b/usr.sbin/bsdconfig/usermgmt/useredit @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,7 +50,7 @@ ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX 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 5376bded106d..d7849ae386dc 100755 --- a/usr.sbin/bsdconfig/usermgmt/usermgmt +++ b/usr.sbin/bsdconfig/usermgmt/usermgmt @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -106,7 +106,7 @@ dialog_menu_main() # # Process command-line arguments # -while getopts hSX flag; do +while getopts dD:hSX flag; do case "$flag" in h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; esac