From 2d88c3d2f6ddc400f2c544a87600299776d917d1 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 13 Nov 2016 16:55:59 +0300 Subject: text.sh: update function interfaces --- %HOME%/.bash_utils/text.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to '%HOME%') diff --git a/%HOME%/.bash_utils/text.sh b/%HOME%/.bash_utils/text.sh index 47e6435..88118f9 100644 --- a/%HOME%/.bash_utils/text.sh +++ b/%HOME%/.bash_utils/text.sh @@ -80,7 +80,7 @@ str_contains() ( set -o errexit -o nounset -o pipefail if [ "$#" -ne 2 ]; then - echo "usage: ${FUNCNAME[0]} STR SUB" + echo "usage: ${FUNCNAME[0]} STR SUB" >&2 return 1 fi @@ -95,7 +95,7 @@ str_starts_with() ( set -o errexit -o nounset -o pipefail if [ "$#" -ne 2 ]; then - echo "usage: ${FUNCNAME[0]} STR SUB" + echo "usage: ${FUNCNAME[0]} STR SUB" >&2 return 1 fi @@ -117,10 +117,10 @@ str_split() ( shift case "$key" in -h|--help) - echo "usage: ${FUNCNAME[0]} [-h|--help] [-0|-z] [--] STR DELIM" + echo "usage: ${FUNCNAME[0]} [-h|--help] [-0|-z|--zero] [--] STR DELIM" return 0 ;; - -0|-z) + -0|-z|--zero) fmt='%s\0' ;; --) @@ -139,7 +139,7 @@ str_split() ( args+=("$@") if [ "${#args[@]}" -ne 2 ]; then - echo "usage: ${FUNCNAME[0]} [-h|--help] [-0|-z] [--] STR DELIM" + echo "usage: ${FUNCNAME[0]} [-h|--help] [-0|-z|--zero] [--] STR DELIM" >&2 return 1 fi @@ -160,7 +160,7 @@ str_join() ( set -o errexit -o nounset -o pipefail if [ "$#" -lt 1 ]; then - echo "usage: ${FUNCNAME[0]} DELIM [STR]..." + echo "usage: ${FUNCNAME[0]} DELIM [STR]..." >&2 return 1 fi -- cgit v1.2.3