From owner-svn-src-all@FreeBSD.ORG Tue Jun 18 09:28:50 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 7DBB88D0; Tue, 18 Jun 2013 09:28:50 +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 57D851A98; Tue, 18 Jun 2013 09:28:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5I9SofK084273; Tue, 18 Jun 2013 09:28:50 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5I9Sop2084271; Tue, 18 Jun 2013 09:28:50 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201306180928.r5I9Sop2084271@svn.freebsd.org> From: Devin Teske Date: Tue, 18 Jun 2013 09:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251919 - in head/usr.sbin/bsdconfig/mouse: . include 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: Tue, 18 Jun 2013 09:28:50 -0000 Author: dteske Date: Tue Jun 18 09:28:49 2013 New Revision: 251919 URL: http://svnweb.freebsd.org/changeset/base/251919 Log: Perform some code consolidation and add some additional error checking/reporting. (similar to SVN revisions 251905 and 251915) Modified: head/usr.sbin/bsdconfig/mouse/include/messages.subr head/usr.sbin/bsdconfig/mouse/mouse Modified: head/usr.sbin/bsdconfig/mouse/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/mouse/include/messages.subr Tue Jun 18 09:26:01 2013 (r251918) +++ head/usr.sbin/bsdconfig/mouse/include/messages.subr Tue Jun 18 09:28:49 2013 (r251919) @@ -86,6 +86,7 @@ msg_thinkingmouse="ThinkingMouse" msg_thinkingmouse_desc="Kensington ThinkingMouse (serial)" msg_trying_to_start_the_mouse_daemon="Trying to start the mouse daemon..." msg_type="Type" +msg_unknown_mouse_menu_selection="Unknown mouse menu selection" msg_unknown_mouse_port_selection="Unknown mouse port selection" msg_unknown_mouse_protocol_selection="Unknown mouse protocol selection" msg_user_confirmation_requested="User Confirmation Requested" Modified: head/usr.sbin/bsdconfig/mouse/mouse ============================================================================== --- head/usr.sbin/bsdconfig/mouse/mouse Tue Jun 18 09:26:01 2013 (r251918) +++ head/usr.sbin/bsdconfig/mouse/mouse Tue Jun 18 09:28:49 2013 (r251919) @@ -120,19 +120,21 @@ while :; do dialog_menu_main || f_die f_dialog_menutag_fetch mtag + command= case "$mtag" in - "X $msg_exit") break ;; - "2 $msg_enable") # Test and run the mouse daemon - $BSDCFG_LIBE/$APP_DIR/enable ${USE_XDIALOG:+-X} ;; - "3 $msg_type") # Select mouse protocol type - $BSDCFG_LIBE/$APP_DIR/type ${USE_XDIALOG:+-X} ;; - "4 $msg_port") # Select mouse port - $BSDCFG_LIBE/$APP_DIR/port ${USE_XDIALOG:+-X} ;; - "5 $msg_flags") # Set additional flags - $BSDCFG_LIBE/$APP_DIR/flags ${USE_XDIALOG:+-X} ;; - "6 $msg_disable") # Disable the mouse daemon - $BSDCFG_LIBE/$APP_DIR/disable ${USE_XDIALOG:+-X} ;; + "X $msg_exit") break ;; + "2 $msg_enable") command=enable ;; # Test and run the mouse daemon + "3 $msg_type") command=type ;; # Select mouse protocol type + "4 $msg_port") command=port ;; # Select mouse port + "5 $msg_flags") command=flags ;; # Set additional flags + "6 $msg_disable") command=disable ;; # Disable the mouse daemon esac + + if [ "$command" ]; then + $BSDCFG_LIBE/$APP_DIR/$command ${USE_XDIALOG:+-X} ;; + else + f_die 1 "$msg_unknown_mouse_menu_selection" + fi done exit $SUCCESS