diff options
author | dteske <dteske@FreeBSD.org> | 2013-06-18 09:28:49 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-06-18 09:28:49 +0000 |
commit | 8b99254b09af6d819d5c76c714e5dba6df6ab447 (patch) | |
tree | 4a40b422c6016dbb82db0a0f3b124029a4cf165f /usr.sbin | |
parent | 953191168e0980273af59b0be117609ebc4aa614 (diff) | |
download | FreeBSD-src-8b99254b09af6d819d5c76c714e5dba6df6ab447.zip FreeBSD-src-8b99254b09af6d819d5c76c714e5dba6df6ab447.tar.gz |
Perform some code consolidation and add some additional error
checking/reporting. (similar to SVN revisions 251905 and 251915)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bsdconfig/mouse/include/messages.subr | 1 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/mouse/mouse | 24 |
2 files changed, 14 insertions, 11 deletions
diff --git a/usr.sbin/bsdconfig/mouse/include/messages.subr b/usr.sbin/bsdconfig/mouse/include/messages.subr index c775096..74d9980 100644 --- a/usr.sbin/bsdconfig/mouse/include/messages.subr +++ b/usr.sbin/bsdconfig/mouse/include/messages.subr @@ -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" diff --git a/usr.sbin/bsdconfig/mouse/mouse b/usr.sbin/bsdconfig/mouse/mouse index b885d9b..9c061a3 100755 --- a/usr.sbin/bsdconfig/mouse/mouse +++ b/usr.sbin/bsdconfig/mouse/mouse @@ -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 |