Improvements to whitespace and comments.

This commit is contained in:
Devin Teske 2013-06-02 22:34:40 +00:00
parent 5b4765c331
commit f4844f65a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251266
12 changed files with 57 additions and 38 deletions

View File

@ -169,7 +169,6 @@ dialog_menu_main()
local hline=
local sanitize_awk="{ gsub(/'/, \"'\\\\''\"); print }"
local menuitem menu_title menu_help menu_selection index=2
for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do
[ $index -lt ${#DIALOG_MENU_TAGS} ] || break

View File

@ -101,7 +101,9 @@ f_ifconfig_media()
# f_dialog_input_options $interface
#
# Input custom interface options.
# Input custom interface options. If the user does not press ESC or choose
# Cancel/No, $options will hold the user's input. Default input is taken from
# the same variable ($options).
#
f_dialog_input_options()
{

View File

@ -1672,7 +1672,7 @@ f_dialog_inputstr_fetch()
#
# Prompt the user with a dialog(1) inputbox to enter some value. The inputbox
# remains until the the user presses ENTER or ESC, or otherwise ends the
# editing session, by selecting `Cancel' for example.
# editing session (by selecting `Cancel' for example).
#
# If the user presses ENTER, the exit status is zero (success), otherwise if
# the user presses ESC the exit status is 255, or if the user chose Cancel, the

View File

@ -171,7 +171,8 @@ f_become_root_via_sudo()
--cancel-label "$msg_cancel" \
--password --inputbox "$prompt" \
$height $width \
2>&1 > /dev/null )
2>&1 > /dev/null
)
retval=$?
# Catch X11-related errors

View File

@ -307,18 +307,18 @@ f_package_menu_categories()
$menu_list
local menu_choice
menu_choice=$( eval $DIALOG \
--title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
--hline \"\$hline\" \
--item-help \
--default-item \"\$defaultitem\" \
--ok-label \"$msg_select\" \
--cancel-label \"$msg_cancel\" \
--menu \"\$prompt\" \
$height $width $rows \
$menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
)
--title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
--hline \"\$hline\" \
--item-help \
--default-item \"\$defaultitem\" \
--ok-label \"$msg_select\" \
--cancel-label \"$msg_cancel\" \
--menu \"\$prompt\" \
$height $width $rows \
$menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
)
local retval=$?
f_dialog_menutag_store -s "$menu_choice"
return $retval
@ -353,7 +353,7 @@ f_package_index_get_page()
fi
}
# f_package_menu_select $category [ $page [ $defaultitem ] ]
# f_package_menu_select $category [$page [$defaultitem]]
#
# Display list of packages for $category, optionally $page N and with a default
# item selected. If $page is omitted, the first page is displayed (but this

View File

@ -63,6 +63,7 @@ dialog_menu_main()
local defaultitem= # Calculated below
local hline="$hline_arrows_tab_enter"
# List of variables we'll need from rc.conf(5)
local var_list="
accounting_enable
local_startup
@ -75,6 +76,7 @@ dialog_menu_main()
startup_dirs
" # END-QUOTE
# Add i386-specific variables if appropriate
if [ "$UNAME_P" = "i386" ]; then
var_list="$var_list
apm_enable

View File

@ -158,7 +158,9 @@ dialog_menu_main()
}'
)"
set -f # noglob
set -f # set noglob because descriptions in the $menu_list may contain
# `*' and get expanded by dialog(1) (doesn't affect Xdialog(1)).
# This prevents dialog(1) from expanding wildcards in help line.
local height width rows
eval f_dialog_menu${SHOW_DESC:+_with_help}_size \

View File

@ -194,7 +194,9 @@ dialog_menu_main()
done
menu_list="$menu_list $menu_buf"
set -f # noglob (descriptions in $RCCONF_MENU_LIST may contain *)
set -f # set noglob because descriptions in the $menu_list may contain
# `*' and get expanded by dialog(1) (doesn't affect Xdialog(1)).
# This prevents dialog(1) from expanding wildcards in help line.
local height width rows
eval f_dialog_menu${SHOW_DESC:+_with_help}_size \
@ -249,11 +251,14 @@ dialog_menu_confirm_delete()
[ $# -ge 1 ] || return $FAILURE
# If asked to delete only one variable, simply ask and return
if [ $# -eq 1 ]; then
f_noyes "$msg_are_you_sure_you_want_to_delete" "$delete_vars"
return $?
fi
# Not reached unless requested to delete multiple variables
# Generate a menu to cleanly display the variables to be deleted
local var_list
var_list=$( for var in $*; do echo "$var"; done | sort -u )
menu_list=$(

View File

@ -69,6 +69,8 @@ dialog_menu_main()
local hline="$hline_arrows_tab_enter"
local defaultitem= # Calculated below
# NOTE: Using a GLOBAL here because caller will need this list to turn
# the menu tag into the menu item with f_dialog_menutag2item()
RCVAR_MENU_LIST="
'X $msg_exit' '$msg_exit_this_menu'
${SHOW_DESC:+'$msg_exit_this_menu'}
@ -124,7 +126,9 @@ dialog_menu_main()
}'
)"
set -f # noglob
set -f # set noglob because descriptions in the $RCVAR_MENU_LIST may
# contain `*' and get expanded by dialog(1). This prevents
# dialog(1) from expanding wildcards in the help line.
local height width rows
eval f_dialog_menu${SHOW_DESC:+_with_help}_size \

View File

@ -278,6 +278,7 @@ f_dialog_input_view_details()
local defaultitem= # calculated below
local hline="$hline_arrows_tab_enter"
# Calculate marks for checkboxes and radio buttons
local md=" "
if [ "$SHOW_DESC" ]; then
md="X"
@ -294,6 +295,7 @@ f_dialog_input_view_details()
defaultitem="3 ($m3) $msg_show_configured"
fi
# Create the menu list with the above-calculated marks
menu_list="
'R $msg_reset' '$msg_reset_desc'
'D [$md] $msg_desc' '$msg_desc_desc'
@ -410,7 +412,9 @@ f_dialog_input_rclist()
}'
)"
set -f # noglob
set -f # set noglob because descriptions in the $menu_list may contain
# `*' and get expanded by dialog(1) (doesn't affect Xdialog(1)).
# This prevents dialog(1) from expanding wildcards in help line.
local height width rows
eval f_dialog_menu${SHOW_DESC:+_with_help}_size \

View File

@ -280,9 +280,9 @@ f_dialog_input_group_gid()
# f_dialog_input_group_members [$group_members]
#
# Allow the user to modify a list of members for a given group. If the user does
# not cancel or press ESC, the $group_members variable will hold the newly-
# configured value upon return.
# Allow the user to modify a list of members for a given group. If the user
# does not cancel or press ESC, the $group_members variable will hold the
# newly-configured value upon return.
#
f_dialog_input_group_members()
{

View File

@ -280,18 +280,18 @@ f_dialog_input_password()
local height1 width1
f_dialog_inputbox_size height1 width1 \
"$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" \
"$prompt1" \
"" \
"$hline"
"$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" \
"$prompt1" \
"" \
"$hline"
local height2 width2
f_dialog_inputbox_size height2 width2 \
"$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" \
"$prompt2" \
"" \
"$hline"
"$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" \
"$prompt2" \
"" \
"$hline"
#
# Loop until the user provides taint-free/valid input
@ -496,9 +496,9 @@ f_dialog_input_change()
$menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
)
retval=$?
retval=$?
f_dialog_data_sanitize date_type
f_dprintf "retval=%u date_type=[%s]" $retval "$date_type"
f_dprintf "retval=%u date_type=[%s]" $retval "$date_type"
# Return if user has either pressed ESC or chosen Cancel/No
[ $retval -eq $SUCCESS ] || return $retval
@ -677,9 +677,9 @@ f_dialog_input_expire()
$menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
)
retval=$?
retval=$?
f_dialog_data_sanitize date_type
f_dprintf "retval=%u date_type=[%s]" $retval "$date_type"
f_dprintf "retval=%u date_type=[%s]" $retval "$date_type"
# Return if user has either pressed ESC or chosen Cancel/No
[ $retval -eq $SUCCESS ] || return $retval