commit 3130746ee0f9e49a21df35a197af80e1991030c5 parent b4d05cf1e81e7c71ccac58f35d0de5543d010b90 Author: Cem Keylan <cem@ckyln.com> Date: Thu, 2 Jul 2020 13:47:53 +0300 sb: don't use cat to print help information Diffstat:
M | sb | | | 24 | ++++++++++-------------- |
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/sb b/sb @@ -4,21 +4,17 @@ FUNCPATH="./func" VERSION="git" +out() { printf '%s\n' "$@" >&2 ;} usage() { - cat <<EOF -${0##*/} [options] - - Options: - -d Use the default configuration - -n Print to stdout instead of the bar - -x Kill existing sb instance - -h Print this help and exit - -v Print version number and exit - -${0##*/}-$VERSION -2019-2020 (c) Cem Keylan -EOF -exit 1 + out "${0##*/} [options]" "" \ + " Options:" \ + " -d Use the default configuration" \ + " -n Print to stdout instead of the bar" \ + " -x Kill existing sb instance" \ + " -v Print version number and exit" ""\ + "${0##*/}-$VERSION" \ + "2019-2020 (c) Cem Keylan" + exit 1 } while [ "$1" ] ; do case "$1" in