summaryrefslogtreecommitdiff
path: root/src/lib/libremessages
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-05-26 20:18:00 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-05-26 20:18:00 -0400
commita608070d29143f11826725ae0261bf0dcd902bc2 (patch)
tree33f860856dcdaba452a0cf60257ca87be1dd1804 /src/lib/libremessages
parentabf473294025868faac6e6c82f01b236c399f524 (diff)
Rename libremessages:whitespace-collapse to whitespace_collapse.v20150526
When using /bin/sh instead of bash (a terrible idea, but whatev), the '-' is an invalid charater in an identifier.
Diffstat (limited to 'src/lib/libremessages')
-rwxr-xr-xsrc/lib/libremessages10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libremessages b/src/lib/libremessages
index 4bea486..151674b 100755
--- a/src/lib/libremessages
+++ b/src/lib/libremessages
@@ -58,12 +58,12 @@ print() {
printf -- "$mesg\n" "$@"
}
-# Usage: whitespace-collapse <<<STRING
+# Usage: whitespace_collapse <<<STRING
#
# Collapses whitespace on stadard I/O, similar to HTML whitespace
# collapsing, with the exception that it puts two spaces between
# sentences. It considers newline, tab, and space to be whitespace.
-whitespace-collapse() {
+whitespace_collapse() {
[[ $# == 0 ]] || panic
tr '\n' '\r' | sed -r \
@@ -79,7 +79,7 @@ whitespace-collapse() {
# printing a paragraph of prose in --help text.
prose() {
[[ $# -ge 1 ]] || panic
- local mesg="$(_ "$(whitespace-collapse <<<"$1")")"; shift
+ local mesg="$(_ "$(whitespace_collapse <<<"$1")")"; shift
printf -- "$mesg" "$@" | fmt -u
}
@@ -88,7 +88,7 @@ prose() {
# remaining lines.
bullet() {
[[ $# -ge 1 ]] || panic
- local mesg="$(_ "$(whitespace-collapse <<<"$1")")"; shift
+ local mesg="$(_ "$(whitespace_collapse <<<"$1")")"; shift
# Wrap the text to 71 columns; 75 (the default) minus a 4 column indent
printf -- "$mesg" "$@" | fmt -u -w 71 | sed -e '1s/^/ - /' -e '2,$s/^/ /'
}
@@ -141,7 +141,7 @@ flag() {
while [[ $# -gt 0 ]]; do
local flag=$1
- local desc="$(_ "$(whitespace-collapse <<<"$2")")"
+ local desc="$(_ "$(whitespace_collapse <<<"$2")")"
shift 2
local lines