mirror of
https://github.com/opnsense/src.git
synced 2026-04-03 16:35:27 -04:00
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.
This commit is contained in:
parent
a0b423e1f7
commit
fd3d4fec40
5 changed files with 35 additions and 43 deletions
|
|
@ -330,25 +330,21 @@ while :; do
|
|||
fi
|
||||
|
||||
case "$mtag" in
|
||||
X) # Exit
|
||||
break
|
||||
;;
|
||||
|
||||
X) break ;;
|
||||
1) # Usage
|
||||
f_show_help "$USAGE_HELPFILE"
|
||||
continue
|
||||
;;
|
||||
|
||||
*) # 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}
|
||||
|
||||
esac
|
||||
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue