From a608070d29143f11826725ae0261bf0dcd902bc2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 26 May 2015 20:18:00 -0400 Subject: Rename libremessages:whitespace-collapse to whitespace_collapse. When using /bin/sh instead of bash (a terrible idea, but whatev), the '-' is an invalid charater in an identifier. --- src/lib/librelib | 4 ++-- src/lib/libremessages | 10 +++++----- src/lib/libremessages.1.ronn | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/librelib b/src/lib/librelib index bc5c5ed..e9d184e 100755 --- a/src/lib/librelib +++ b/src/lib/librelib @@ -34,14 +34,14 @@ print() { printf -- "$mesg\n" "$@" } -whitespace-collapse() { +whitespace_collapse() { tr '\n' '\r' | sed -r \ -e 's/\r/ /g' -e 's/\t/ /g' \ -e 's/(^|[^.!? ]) +/\1 /g' -e 's/([.!?]) +/\1 /g' } prose() { - local mesg="$(_ "$(whitespace-collapse <<<"$1")")"; shift + local mesg="$(_ "$(whitespace_collapse <<<"$1")")"; shift printf -- "$mesg" "$@" | fmt -u } 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 << is a `printf`(1)-formatted string that is fed through `gettext`, and are its arguments. - * `whitespace-collapse`: + * `whitespace_collapse`: 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 -- cgit v1.2.3-54-g00ecf