summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/mouse
diff options
context:
space:
mode:
authordteske <dteske@FreeBSD.org>2013-06-18 09:28:49 +0000
committerdteske <dteske@FreeBSD.org>2013-06-18 09:28:49 +0000
commit8b99254b09af6d819d5c76c714e5dba6df6ab447 (patch)
tree4a40b422c6016dbb82db0a0f3b124029a4cf165f /usr.sbin/bsdconfig/mouse
parent953191168e0980273af59b0be117609ebc4aa614 (diff)
downloadFreeBSD-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/bsdconfig/mouse')
-rw-r--r--usr.sbin/bsdconfig/mouse/include/messages.subr1
-rwxr-xr-xusr.sbin/bsdconfig/mouse/mouse24
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
OpenPOWER on IntegriCloud