diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-13 16:55:59 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-13 16:55:59 +0300 |
commit | 2d88c3d2f6ddc400f2c544a87600299776d917d1 (patch) | |
tree | 808e2aa9aff7469708d0c944a8abf9684ff068bc | |
parent | rename MinGW-w64 aliases (diff) | |
download | linux-home-2d88c3d2f6ddc400f2c544a87600299776d917d1.tar.gz linux-home-2d88c3d2f6ddc400f2c544a87600299776d917d1.zip |
text.sh: update function interfaces
-rw-r--r-- | %HOME%/.bash_utils/text.sh | 12 |
1 files changed, 6 insertions, 6 deletions
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 |