Added '--underline on/off' and '' to toggle it

This commit is contained in:
Dylan 2016-02-06 10:25:12 +11:00
parent 941c556012
commit a80d50b0ff
2 changed files with 16 additions and 2 deletions

View File

@ -196,6 +196,10 @@ line_wrap="on"
# --bold on/off # --bold on/off
bold="on" bold="on"
# Enable/Disable Underline
# --underline on/off
underline="on"
# Underline character # Underline character
# --underline_char char # --underline_char char
underline_char="-" underline_char="-"

14
fetch
View File

@ -216,6 +216,10 @@ line_wrap="on"
# --bold on/off # --bold on/off
bold="on" bold="on"
# Enable/Disable Underline
# --underline on/off
underline="on"
# Underline character # Underline character
# --underline_char char # --underline_char char
underline_char="-" underline_char="-"
@ -1827,8 +1831,13 @@ prin () {
# Underline {{{ # Underline {{{
getunderline () { getunderline () {
underline=$(printf %"$length"s) case "$underline" in
underline=${underline// /$underline_char} "on")
underline=$(printf %"$length"s)
underline=${underline// /$underline_char}
;;
"off") underline="" ;;
esac
} }
# }}} # }}}
@ -2087,6 +2096,7 @@ while [ "$1" ]; do
--info_color) info_color=$2 ;; --info_color) info_color=$2 ;;
# Text Formatting # Text Formatting
--underline) underline="$2" ;;
--underline_char) underline_char="$2" ;; --underline_char) underline_char="$2" ;;
--line_wrap) line_wrap="$2" ;; --line_wrap) line_wrap="$2" ;;
--bold) bold="$2" ;; --bold) bold="$2" ;;