From owner-svn-src-head@FreeBSD.ORG Fri Nov 16 00:59:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77AC0E99; Fri, 16 Nov 2012 00:59:13 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 56EF38FC0C; Fri, 16 Nov 2012 00:59:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG0xDEN087969; Fri, 16 Nov 2012 00:59:13 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG0xCsR087925; Fri, 16 Nov 2012 00:59:12 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201211160059.qAG0xCsR087925@svn.freebsd.org> From: Devin Teske Date: Fri, 16 Nov 2012 00:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243112 - in head/usr.sbin/bsdconfig: . console diskmgmt docsinstall dot mouse networking password security share startup timezone ttys usermgmt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 00:59:13 -0000 Author: dteske Date: Fri Nov 16 00:59:11 2012 New Revision: 243112 URL: http://svnweb.freebsd.org/changeset/base/243112 Log: Replicate a feature from sysinstall documented in stable/9/usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below): If /usr/sbin/sysinstall is linked to another filename, say `/usr/local/bin/configPackages', then the basename will be used as an implicit command name. To get a list of modules you can link to, see `bsdconfig -h' output. Approved by: adrian (co-mentor) (implicit) Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/console/console head/usr.sbin/bsdconfig/console/font head/usr.sbin/bsdconfig/console/keymap head/usr.sbin/bsdconfig/console/repeat head/usr.sbin/bsdconfig/console/saver head/usr.sbin/bsdconfig/console/screenmap head/usr.sbin/bsdconfig/console/ttys head/usr.sbin/bsdconfig/diskmgmt/diskmgmt head/usr.sbin/bsdconfig/docsinstall/docsinstall head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/mouse/disable head/usr.sbin/bsdconfig/mouse/enable head/usr.sbin/bsdconfig/mouse/flags head/usr.sbin/bsdconfig/mouse/mouse head/usr.sbin/bsdconfig/mouse/port head/usr.sbin/bsdconfig/mouse/type head/usr.sbin/bsdconfig/networking/defaultrouter head/usr.sbin/bsdconfig/networking/devices head/usr.sbin/bsdconfig/networking/hostname head/usr.sbin/bsdconfig/networking/nameservers head/usr.sbin/bsdconfig/networking/networking head/usr.sbin/bsdconfig/password/password head/usr.sbin/bsdconfig/security/kern_securelevel head/usr.sbin/bsdconfig/security/security head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/startup/misc head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/startup/rcconf head/usr.sbin/bsdconfig/startup/rcdelete head/usr.sbin/bsdconfig/startup/rcedit head/usr.sbin/bsdconfig/startup/rcvar head/usr.sbin/bsdconfig/startup/startup head/usr.sbin/bsdconfig/timezone/timezone head/usr.sbin/bsdconfig/ttys/ttys head/usr.sbin/bsdconfig/usermgmt/groupadd head/usr.sbin/bsdconfig/usermgmt/groupdel head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/groupinput head/usr.sbin/bsdconfig/usermgmt/useradd head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit head/usr.sbin/bsdconfig/usermgmt/userinput head/usr.sbin/bsdconfig/usermgmt/usermgmt Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/bsdconfig Fri Nov 16 00:59:11 2012 (r243112) @@ -202,6 +202,16 @@ dialog_menu_main() ############################################################ MAIN # +# If $0 is not "bsdconfig", interpret it as a keyword to a menuitem +# +if [ "$pgm" != "bsdconfig" ] && + indexfile=$( f_index_file "$pgm" ) && + cmd=$( f_index_menusel_command "$indexfile" "$pgm" ) +then + exec "$cmd" "$@" || exit 1 +fi + +# # Process command-line arguments # while getopts hSX flag; do @@ -244,51 +254,18 @@ if [ "$1" ]; then esac # - # Find the INDEX (possibly i18n) claiming this keyword + # Find the INDEX (possibly i18n) claiming this keyword and get the + # command to execute from the menu_selection line. # - lang="${LANG:-$LC_ALL}" - if [ "$lang" ]; then - sel=$( grep "^menu_selection=\"$1|" */INDEX.$lang \ - 2> /dev/null | tail -1 ) - - # Fall-back to non-i18n sources if nothing was found - [ "$sel" ] || - sel=$( grep "^menu_selection=\"$1|" */INDEX | tail -1 ) - else - sel=$( grep "^menu_selection=\"$1|" */INDEX | tail -1 ) - fi - - # - # If no matches, display usage (which shows valid keywords) - # - if [ ! "$sel" ]; then + if ! { indexfile=$( f_index_file "$1" ) && + cmd=$( f_index_menusel_command "$indexfile" "$1" ) + }; then + # no matches, display usage (which shows valid keywords) f_err "%s: %s: $msg_not_found\n" "$pgm" "$1" usage fi - # - # The command to execute is after the pipe-character (|) in the - # menu_selection property of the INDEX file for the menuitem. - # - cmd="${sel#*|}" - cmd="${cmd%\"}" - if [ ! "$cmd" ]; then - echo "$pgm: $1: $msg_not_found" - usage - fi shift - - # - # If the command pathname is not fully qualified fix-up/force to be - # relative to the menuitem directory. - # - case "$cmd" in - /*) : already fully qualified ;; - *) - dir="${sel%%/*}" - cmd="$dir/$cmd" - esac - exec $cmd ${USE_XDIALOG:+-X} "$@" || exit 1 fi Modified: head/usr.sbin/bsdconfig/console/console ============================================================================== --- head/usr.sbin/bsdconfig/console/console Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/console/console Fri Nov 16 00:59:11 2012 (r243112) @@ -36,7 +36,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/console/font ============================================================================== --- head/usr.sbin/bsdconfig/console/font Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/console/font Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/console/keymap ============================================================================== --- head/usr.sbin/bsdconfig/console/keymap Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/console/keymap Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/console/repeat ============================================================================== --- head/usr.sbin/bsdconfig/console/repeat Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/console/repeat Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/console/saver ============================================================================== --- head/usr.sbin/bsdconfig/console/saver Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/console/saver Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/console/screenmap ============================================================================== --- head/usr.sbin/bsdconfig/console/screenmap Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/console/screenmap Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/console/ttys ============================================================================== --- head/usr.sbin/bsdconfig/console/ttys Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/console/ttys Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="080.console" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/diskmgmt/diskmgmt ============================================================================== --- head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/diskmgmt/diskmgmt Fri Nov 16 00:59:11 2012 (r243112) @@ -36,7 +36,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="050.diskmgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/docsinstall/docsinstall ============================================================================== --- head/usr.sbin/bsdconfig/docsinstall/docsinstall Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/docsinstall/docsinstall Fri Nov 16 00:59:11 2012 (r243112) @@ -36,7 +36,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="020.docsinstall" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/dot/dot Fri Nov 16 00:59:11 2012 (r243112) @@ -35,7 +35,7 @@ BSDCFG_LIBE="/usr/libexec/bsdconfig" APP f_include_lang $BSDCFG_LIBE/include/messages.subr f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/mouse/disable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/disable Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/mouse/disable Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/mouse/enable ============================================================================== --- head/usr.sbin/bsdconfig/mouse/enable Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/mouse/enable Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/mouse/flags ============================================================================== --- head/usr.sbin/bsdconfig/mouse/flags Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/mouse/flags Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/mouse/mouse Fri Nov 16 00:59:11 2012 (r243112) @@ -36,7 +36,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/mouse/port ============================================================================== --- head/usr.sbin/bsdconfig/mouse/port Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/mouse/port Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/mouse/type ============================================================================== --- head/usr.sbin/bsdconfig/mouse/type Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/mouse/type Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="110.mouse" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/networking/defaultrouter ============================================================================== --- head/usr.sbin/bsdconfig/networking/defaultrouter Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/networking/defaultrouter Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/networking/routi BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/devices ============================================================================== --- head/usr.sbin/bsdconfig/networking/devices Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/networking/devices Fri Nov 16 00:59:11 2012 (r243112) @@ -41,7 +41,7 @@ f_include $BSDCFG_SHARE/networking/netma BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/hostname ============================================================================== --- head/usr.sbin/bsdconfig/networking/hostname Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/networking/hostname Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/networking/hostn BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/nameservers ============================================================================== --- head/usr.sbin/bsdconfig/networking/nameservers Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/networking/nameservers Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/networking/resol BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/networking/networking ============================================================================== --- head/usr.sbin/bsdconfig/networking/networking Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/networking/networking Fri Nov 16 00:59:11 2012 (r243112) @@ -36,7 +36,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="120.networking" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/password/password ============================================================================== --- head/usr.sbin/bsdconfig/password/password Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/password/password Fri Nov 16 00:59:11 2012 (r243112) @@ -36,7 +36,7 @@ f_include $BSDCFG_SHARE/password/passwor BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="040.password" -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/security/kern_securelevel ============================================================================== --- head/usr.sbin/bsdconfig/security/kern_securelevel Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/security/kern_securelevel Fri Nov 16 00:59:11 2012 (r243112) @@ -39,7 +39,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc SECURELEVEL_HELPFILE=$BSDCFG_LIBE/$APP_DIR/include/securelevel.hlp -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/security/security ============================================================================== --- head/usr.sbin/bsdconfig/security/security Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/security/security Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="130.security" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/share/common.subr Fri Nov 16 00:59:11 2012 (r243112) @@ -271,50 +271,186 @@ f_usage() exit $FAILURE } -# f_index_menu_selection $file $pgm +# f_index_file $keyword +# +# Process all INDEX files known to bsdconfig and return the path to first file +# containing a menu_selection line with a keyword portion matching $keyword. +# +# If $LANG or $LC_ALL (in order of preference, respectively) is set, +# "INDEX.encoding" files will be searched first. +# +# If no file is found, error status is returned along with the NULL string. +# +# This function is a two-parter. Below is the awk(1) portion of the function, +# afterward is the sh(1) function which utilizes the below awk script. +# +f_index_file_awk=' +# Variables that should be defined on the invocation line: +# -v keyword="keyword" +BEGIN { found = 0 } +( $0 ~ "^menu_selection=\"" keyword "\\|" ) { + print FILENAME + found++ + exit +} +END { exit ! found } +' +f_index_file() +{ + local keyword="$1" + local lang="${LANG:-$LC_ALL}" + + f_dprintf "lang=[$lang]" + + if [ "$lang" ]; then + awk -v keyword="$keyword" "$f_index_file_awk" \ + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && + return + # No match, fall-thru to non-i18n sources + fi + awk -v keyword="$keyword" "$f_index_file_awk" \ + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX +} + +# f_index_menusel_keyword $indexfile $pgm +# +# Process $indexfile and return only the keyword portion of the menu_selection +# line with a command portion matching $pgm. # -# Process $file looking for $menu_selection values that correspond to $pgm. # This function is for internationalization (i18n) mapping of the on-disk # scriptname ($pgm) into the localized language (given language-specific -# $file). If $LANG or $LC_ALL (in orderder of preference, respectively) is set, -# ".encoding" will automatically be appended as a suffix to the provided $file -# pathname. -# -# If, within $file, multiple $menu_selection values map to $pgm, only the first -# one will be returned. If no mapping can be made, the NULL string is returned. +# $indexfile). If $LANG or $LC_ALL (in orderder of preference, respectively) is +# set, ".encoding" will automatically be appended as a suffix to the provided +# $indexfile pathname. +# +# If, within $indexfile, multiple $menu_selection values map to $pgm, only the +# first one will be returned. If no mapping can be made, the NULL string is +# returned. # -# If $file does not exist, error status is returned along with the NULL string. +# If $indexfile does not exist, error status is returned with NULL. # # This function is a two-parter. Below is the awk(1) portion of the function, # afterward is the sh(1) function which utilizes the below awk script. # -f_index_menusel_awk=' +f_index_menusel_keyword_awk=' # Variables that should be defined on the invocation line: # -v pgm="program_name" # -( $0 ~ "^menu_selection=.*\\|" pgm "\"" ) { - sub(/\|.*/, "") - sub(/^menu_selection="/, "") - print - exit +BEGIN { + prefix = "menu_selection=\"" + plen = length(prefix) + found = 0 +} +{ + if (!match($0, "^" prefix ".*\\|.*\"")) next + + keyword = command = substr($0, plen + 1, RLENGTH - plen - 1) + sub(/^.*\|/, "", command) + sub(/\|.*$/, "", keyword) + + if ( command == pgm ) + { + print keyword + found++ + exit + } } +END { exit ! found } ' -f_index_menu_selection() +f_index_menusel_keyword() { - local file="$1" pgm="$2" + local indexfile="$1" pgm="$2" local lang="${LANG:-$LC_ALL}" f_dprintf "lang=[$lang]" - if [ -f "$file.$lang" ]; then - awk -v pgm="$pgm" "$f_index_menusel_awk" "$file.$lang" || - exit $FAILURE - elif [ -f "$file" ]; then - awk -v pgm="$pgm" "$f_index_menusel_awk" "$file" || - exit $FAILURE + if [ -f "$indexfile.$lang" ]; then + awk -v pgm="$pgm" \ + "$f_index_menusel_keyword_awk" \ + "$indexfile.$lang" + elif [ -f "$indexfile" ]; then + awk -v pgm="$pgm" \ + "$f_index_menusel_keyword_awk" \ + "$indexfile" + fi +} + +# f_index_menusel_command $indexfile $keyword +# +# Process $indexfile and return only the command portion of the menu_selection +# line with a keyword portion matching $keyword. +# +# This function is for mapping [possibly international] keywords into the +# command to be executed. If $LANG or $LC_ALL (order of preference) is set, +# ".encoding" will automatically be appended as a suffix to the provided +# $indexfile pathname. +# +# If, within $indexfile, multiple $menu_selection values map to $keyword, only +# the first one will be returned. If no mapping can be made, the NULL string is +# returned. +# +# If $indexfile doesn't exist, error status is returned with NULL. +# +# This function is a two-parter. Below is the awk(1) portion of the function, +# afterward is the sh(1) function which utilizes the below awk script. +# +f_index_menusel_command_awk=' +# Variables that should be defined on the invocation line: +# -v key="keyword" +# +BEGIN { + prefix = "menu_selection=\"" + plen = length(prefix) + found = 0 +} +{ + if (!match($0, "^" prefix ".*\\|.*\"")) next + + keyword = command = substr($0, plen + 1, RLENGTH - plen - 1) + sub(/^.*\|/, "", command) + sub(/\|.*$/, "", keyword) + + if ( keyword == key ) + { + print command + found++ + exit + } +} +END { exit ! found } +' +f_index_menusel_command() +{ + local indexfile="$1" keyword="$2" command + local lang="${LANG:-$LC_ALL}" + + f_dprintf "lang=[$lang]" + + if [ -f "$indexfile.$lang" ]; then + command=$( awk -v key="$keyword" \ + "$f_index_menusel_command_awk" \ + "$indexfile.$lang" ) || return $FAILURE + elif [ -f "$indexfile" ]; then + command=$( awk -v key="$keyword" \ + "$f_index_menusel_command_awk" \ + "$indexfile" ) || return $FAILURE else return $FAILURE fi + + # + # If the command pathname is not fully qualified fix-up/force to be + # relative to the $indexfile directory. + # + case "$command" in + /*) : already fully qualified ;; + *) + local indexdir="${indexfile%/*}" + [ "$indexdir" != "$indexfile" ] || indexdir="." + command="$indexdir/$command" + esac + + echo "$command" } ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/misc ============================================================================== --- head/usr.sbin/bsdconfig/startup/misc Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/startup/misc Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/sysrc.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ GLOBALS Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/startup/rcadd Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/startup/rcconf.s BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ GLOBALS Modified: head/usr.sbin/bsdconfig/startup/rcconf ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcconf Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/startup/rcconf Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/startup/rcconf.s BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ GLOBALS Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/startup/rcdelete Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/startup/rcconf.s BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ GLOBALS Modified: head/usr.sbin/bsdconfig/startup/rcedit ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcedit Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/startup/rcedit Fri Nov 16 00:59:11 2012 (r243112) @@ -37,7 +37,7 @@ f_include $BSDCFG_SHARE/startup/rcedit.s BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/startup/rcvar ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcvar Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/startup/rcvar Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/startup/rcvar.su BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ GLOBALS Modified: head/usr.sbin/bsdconfig/startup/startup ============================================================================== --- head/usr.sbin/bsdconfig/startup/startup Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/startup/startup Fri Nov 16 00:59:11 2012 (r243112) @@ -36,7 +36,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="140.startup" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS Modified: head/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- head/usr.sbin/bsdconfig/timezone/timezone Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/timezone/timezone Fri Nov 16 00:59:11 2012 (r243112) @@ -42,7 +42,7 @@ f_include $BSDCFG_SHARE/timezone/zones.s BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="090.timezone" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/ttys/ttys ============================================================================== --- head/usr.sbin/bsdconfig/ttys/ttys Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/ttys/ttys Fri Nov 16 00:59:11 2012 (r243112) @@ -36,7 +36,7 @@ f_include $BSDCFG_SHARE/mustberoot.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="150.ttys" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/usermgmt/groupadd ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupadd Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/groupadd Fri Nov 16 00:59:11 2012 (r243112) @@ -35,7 +35,7 @@ f_include $BSDCFG_SHARE/dialog.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/usermgmt/groupdel ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupdel Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/groupdel Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/usermgmt/group_i BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/usermgmt/groupedit ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupedit Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/groupedit Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/usermgmt/group_i BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/usermgmt/groupinput ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupinput Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/groupinput Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/usermgmt/group_i BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/usermgmt/useradd ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/useradd Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/useradd Fri Nov 16 00:59:11 2012 (r243112) @@ -35,7 +35,7 @@ f_include $BSDCFG_SHARE/dialog.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/usermgmt/userdel ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/userdel Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/userdel Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/usermgmt/user_in BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/usermgmt/useredit ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/useredit Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/useredit Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/usermgmt/user_in BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ MAIN Modified: head/usr.sbin/bsdconfig/usermgmt/userinput ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/userinput Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/userinput Fri Nov 16 00:59:11 2012 (r243112) @@ -38,7 +38,7 @@ f_include $BSDCFG_SHARE/usermgmt/user_in BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="070.usermgmt" f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ CONFIGURATION Modified: head/usr.sbin/bsdconfig/usermgmt/usermgmt ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/usermgmt Fri Nov 16 00:23:23 2012 (r243111) +++ head/usr.sbin/bsdconfig/usermgmt/usermgmt Fri Nov 16 00:59:11 2012 (r243112) @@ -39,7 +39,7 @@ f_include_lang $BSDCFG_LIBE/$APP_DIR/inc USERMGMT_HELPFILE=$BSDCFG_LIBE/$APP_DIR/include/usermgmt.hlp -ipgm=$( f_index_menu_selection $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) [ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" ############################################################ FUNCTIONS