28c28
< # $FreeBSD: head/usr.sbin/bsdconfig/share/common.subr 241899 2012-10-22 18:01:38Z dteske $
---
> # $FreeBSD: head/usr.sbin/bsdconfig/share/common.subr 242107 2012-10-26 00:31:25Z dteske $
142a143,173
> # f_show_help $file
> #
> # Display a language help-file. Automatically takes $LANG and $LC_ALL into
> # consideration when displaying $file (suffix ".$LC_ALL" or ".$LANG" will
> # automatically be added prior to loading the language help-file).
> #
> # If a language has been requested by setting either $LANG or $LC_ALL in the
> # environment and the language-specific help-file does not exist we will fall
> # back to $file without-suffix.
> #
> # If the language help-file does not exist, an error is displayed instead.
> #
> f_show_help()
> {
> local file="$1"
> local lang="${LANG:-$LC_ALL}"
>
> [ -f "$file.$lang" ] && file="$file.$lang"
>
> #
> # Use f_dialog_textbox from dialog.subr if possible, otherwise fall
> # back to dialog(1) (without options, making it obvious when using
> # un-aided system dialog).
> #
> if f_have f_dialog_textbox; then
> f_dialog_textbox "$file"
> else
> dialog --msgbox "$( cat "$file" 2>&1 )" 0 0
> fi
> }
>
182,215d212
< # f_include_help NAME [$file]
< #
< # When given both arguments, cache the contents of a language help-file to
< # later be retrieved by executing again with only the first argument.
< #
< # Automatically takes $LANG and $LC_ALL into consideration when reading $file
< # (suffix ".$LC_ALL" or ".$LANG" will automatically be added prior to loading
< # the language help-file).
< #
< # If a language has been requested by setting either $LANG or $LC_ALL in the
< # environment and the language-specific help-file does not exist we will fall
< # back to $file without-suffix.
< #
< # If the language help-file does not exist, an error is cached in place of the
< # help-file contents.
< #
< f_include_help()
< {
< local name="$1" file="$2"
<
< if [ "$file" ]; then
< local lang="${LANG:-$LC_ALL}"
<
< f_dprintf "name=[$name] lang=[$lang]"
< if [ -f "$file.$lang" ]; then
< setvar HELP_${name}_$$ "$( cat "$file.$lang" 2>&1 )"
< else
< setvar HELP_${name}_$$ "$( cat "$file" 2>&1 )"
< fi
< else
< eval echo \"\$HELP_${name}_$$\"
< fi
< }
<
< # $FreeBSD: head/usr.sbin/bsdconfig/share/common.subr 241899 2012-10-22 18:01:38Z dteske $
---
> # $FreeBSD: head/usr.sbin/bsdconfig/share/common.subr 242107 2012-10-26 00:31:25Z dteske $
142a143,173
> # f_show_help $file
> #
> # Display a language help-file. Automatically takes $LANG and $LC_ALL into
> # consideration when displaying $file (suffix ".$LC_ALL" or ".$LANG" will
> # automatically be added prior to loading the language help-file).
> #
> # If a language has been requested by setting either $LANG or $LC_ALL in the
> # environment and the language-specific help-file does not exist we will fall
> # back to $file without-suffix.
> #
> # If the language help-file does not exist, an error is displayed instead.
> #
> f_show_help()
> {
> local file="$1"
> local lang="${LANG:-$LC_ALL}"
>
> [ -f "$file.$lang" ] && file="$file.$lang"
>
> #
> # Use f_dialog_textbox from dialog.subr if possible, otherwise fall
> # back to dialog(1) (without options, making it obvious when using
> # un-aided system dialog).
> #
> if f_have f_dialog_textbox; then
> f_dialog_textbox "$file"
> else
> dialog --msgbox "$( cat "$file" 2>&1 )" 0 0
> fi
> }
>
182,215d212
< # f_include_help NAME [$file]
< #
< # When given both arguments, cache the contents of a language help-file to
< # later be retrieved by executing again with only the first argument.
< #
< # Automatically takes $LANG and $LC_ALL into consideration when reading $file
< # (suffix ".$LC_ALL" or ".$LANG" will automatically be added prior to loading
< # the language help-file).
< #
< # If a language has been requested by setting either $LANG or $LC_ALL in the
< # environment and the language-specific help-file does not exist we will fall
< # back to $file without-suffix.
< #
< # If the language help-file does not exist, an error is cached in place of the
< # help-file contents.
< #
< f_include_help()
< {
< local name="$1" file="$2"
<
< if [ "$file" ]; then
< local lang="${LANG:-$LC_ALL}"
<
< f_dprintf "name=[$name] lang=[$lang]"
< if [ -f "$file.$lang" ]; then
< setvar HELP_${name}_$$ "$( cat "$file.$lang" 2>&1 )"
< else
< setvar HELP_${name}_$$ "$( cat "$file" 2>&1 )"
< fi
< else
< eval echo \"\$HELP_${name}_$$\"
< fi
< }
<