diff options
author | dteske <dteske@FreeBSD.org> | 2013-04-22 05:02:34 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-04-22 05:02:34 +0000 |
commit | 6089bf07c71a6fd15cb36b50f7801a4b09037460 (patch) | |
tree | 30a8b20faa65aa281c83e178629b4b01903d9fef /usr.sbin | |
parent | 78339bf7f3a0cd62b1bcf122e6ca71e724ee1df9 (diff) | |
download | FreeBSD-src-6089bf07c71a6fd15cb36b50f7801a4b09037460.zip FreeBSD-src-6089bf07c71a6fd15cb36b50f7801a4b09037460.tar.gz |
Add new flags `-d' (sets debug=1) and `-D file' (sets debugFile) and
improve debugging initialization. Also fixup USAGE statements while we're
here. Also, change initialization of main program to _not_ change working
directory, allowing the debugFile to be relative without confusion.
Diffstat (limited to 'usr.sbin')
56 files changed, 228 insertions, 129 deletions
diff --git a/usr.sbin/bsdconfig/USAGE b/usr.sbin/bsdconfig/USAGE index eac7dbe..653933e 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 07b73fe..6ca788d 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 9aa4dca..db5a473 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 5f3b7af..2352559 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 022952f..763a94c 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 5518140..f10b79e 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 93357e8..face69e 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 4f6729b..1036b20 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 5c5e29e..27ce53c 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 3f9945e..e06a2a7 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 9aa4dca..db5a473 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 27852fb..b8b97dc 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 9aa4dca..db5a473 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 52e0479..141bc7f 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 c1c0dc3..a1ccf73 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 2cc659c..cbe9ad5 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 9aa4dca..db5a473 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 0f41d73..2a2cfb4 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 f401461..43abac5 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 06218ac..0705139 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 95d7677..e8ce3d0 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 87d4a0b..55c4eb7 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 ee9c4ed..0bd0e06 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 a4dd74c..b8e2fea 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 44e522e..cc43f85 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 f9c27b4..dd1fb37 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 231320e..ab74ae6 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 9ebebc8..1c2b7a0 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 8acfbde..d3c8a8d 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 9aa4dca..db5a473 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 50d963d..f63e455 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 9aa4dca..db5a473 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 42594c6..5307bca 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 f503e51..ff582ad 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 cb9096f..d1a3c00 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 2ead592..ebfe812 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 9aa4dca..db5a473 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 37bb80f..5a8c859 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 3bea670..0266149 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 d09874b..1fb01b0 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 578b13e..3e21658 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 0114368..b97211f 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 d655e61..5ac41ef 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 c9229b7..331989c 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 a88369c..cdd7d9a 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 5649b60..c232344 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 9aa4dca..db5a473 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 db7cb20..f0c7c2a 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 9aa4dca..db5a473 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 34962a9..b9bfce8 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 b51f002..38fe311 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 c192c0f..93036e1 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 8a69729..1dbf0cd 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 4a7e2be..02f6e65 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 67aba07..00e6ae5 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 5376bde..d7849ae 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 |