From owner-svn-src-all@FreeBSD.ORG Thu Jun 20 05:48:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 188E6F55; Thu, 20 Jun 2013 05:48:10 +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 0AEEA1B0B; Thu, 20 Jun 2013 05:48:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5K5m9AJ031865; Thu, 20 Jun 2013 05:48:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5K5m9mt031860; Thu, 20 Jun 2013 05:48:09 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306200548.r5K5m9mt031860@svn.freebsd.org> From: Devin Teske Date: Thu, 20 Jun 2013 05:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252019 - in head/usr.sbin/bsdconfig: . startup usermgmt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jun 2013 05:48:10 -0000 Author: dteske Date: Thu Jun 20 05:48:08 2013 New Revision: 252019 URL: http://svnweb.freebsd.org/changeset/base/252019 Log: When the fall-back of a case-statement is the last thing executed in a while-loop _and_ all prior matches in the same case-statement either break or continue, we can safely break the fall-back out of the case-statement. This should improve readability and allow for longer-lines by reducing the level of indentation by-one for the fall-back case. Modified: head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/startup/rcadd head/usr.sbin/bsdconfig/usermgmt/groupedit head/usr.sbin/bsdconfig/usermgmt/userdel head/usr.sbin/bsdconfig/usermgmt/useredit Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Thu Jun 20 05:42:21 2013 (r252018) +++ head/usr.sbin/bsdconfig/bsdconfig Thu Jun 20 05:48:08 2013 (r252019) @@ -330,25 +330,21 @@ while :; do fi case "$mtag" in - X) # Exit - break - ;; - + X) break ;; 1) # Usage f_show_help "$USAGE_HELPFILE" continue - ;; + esac - *) # Dynamically loaded menuitem - f_getvar menu_program$mtag menu_program - case "$menu_program" in - /*) cmd="$menu_program";; - *) cmd="$BSDCFG_LIBE/$menu_program" - esac - f_dprintf "cmd=[%s]" "$cmd" - $cmd ${USE_XDIALOG:+-X} + # Anything else is a dynamically loaded menuitem + f_getvar menu_program$mtag menu_program + case "$menu_program" in + /*) cmd="$menu_program";; + *) cmd="$BSDCFG_LIBE/$menu_program" esac + f_dprintf "cmd=[%s]" "$cmd" + $cmd ${USE_XDIALOG:+-X} done exit $SUCCESS Modified: head/usr.sbin/bsdconfig/startup/rcadd ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcadd Thu Jun 20 05:42:21 2013 (r252018) +++ head/usr.sbin/bsdconfig/startup/rcadd Thu Jun 20 05:48:08 2013 (r252019) @@ -127,13 +127,12 @@ while :; do f_dialog_menutag_fetch mtag defaultitem="$mtag" - case "$mtag" in - "X $msg_exit" ) break ;; - *) # Anything else is a directive - rcvar="${mtag# }" - $BSDCFG_LIBE/$APP_DIR/rcedit \ - ${USE_XDIALOG:+-X} "$rcvar" - esac + [ "$mtag" = "X $msg_exit" ] && break + + # Anything else is a directive + + $BSDCFG_LIBE/$APP_DIR/rcedit ${USE_XDIALOG:+-X} \ + "${mtag# }" done ;; 2) # Add Custom Modified: head/usr.sbin/bsdconfig/usermgmt/groupedit ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/groupedit Thu Jun 20 05:42:21 2013 (r252018) +++ head/usr.sbin/bsdconfig/usermgmt/groupedit Thu Jun 20 05:48:08 2013 (r252019) @@ -77,13 +77,12 @@ while :; do [ $retval -eq 0 ] || f_die - case "$mtag" in - "X $msg_exit") break ;; - *) # anything else is a group name - $BSDCFG_LIBE/$APP_DIR/groupinput \ - ${USE_XDIALOG:+-X} mode="Edit/View" group="$mtag" - ;; - esac + [ "$mtag" = "X $msg_exit" ] && break + + # Anything else is a group name + + $BSDCFG_LIBE/$APP_DIR/groupinput \ + ${USE_XDIALOG:+-X} mode="Edit/View" group="$mtag" done exit $SUCCESS Modified: head/usr.sbin/bsdconfig/usermgmt/userdel ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/userdel Thu Jun 20 05:42:21 2013 (r252018) +++ head/usr.sbin/bsdconfig/usermgmt/userdel Thu Jun 20 05:48:08 2013 (r252019) @@ -77,13 +77,12 @@ while :; do [ $retval -eq 0 ] || f_die - case "$mtag" in - "X $msg_exit") break ;; - *) # anything else is a userid - $BSDCFG_LIBE/$APP_DIR/userinput \ - ${USE_XDIALOG:+-X} mode="Delete" user="$mtag" - ;; - esac + [ "$mtag" = "X $msg_exit" ] && break + + # Anything else is a userid + + $BSDCFG_LIBE/$APP_DIR/userinput \ + ${USE_XDIALOG:+-X} mode="Delete" user="$mtag" done exit $SUCCESS Modified: head/usr.sbin/bsdconfig/usermgmt/useredit ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/useredit Thu Jun 20 05:42:21 2013 (r252018) +++ head/usr.sbin/bsdconfig/usermgmt/useredit Thu Jun 20 05:48:08 2013 (r252019) @@ -77,13 +77,12 @@ while :; do [ $retval -eq 0 ] || f_die - case "$mtag" in - "X $msg_exit") break ;; - *) # anything else is a userid - $BSDCFG_LIBE/$APP_DIR/userinput \ - ${USE_XDIALOG:+-X} mode="Edit/View" user="$mtag" - ;; - esac + [ "$mtag" = "X $msg_exit" ] && break + + # Anything else is a userid + + $BSDCFG_LIBE/$APP_DIR/userinput \ + ${USE_XDIALOG:+-X} mode="Edit/View" user="$mtag" done exit $SUCCESS