From f6ccc7caa1d80c7a2fcc6486f872d54468d265dc Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 26 May 2013 23:10:37 -0400 Subject: librelib: fix usage() --- src/librelib | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/librelib b/src/librelib index 22811db..3b12c93 100755 --- a/src/librelib +++ b/src/librelib @@ -16,14 +16,20 @@ default_libdir=/usr/lib/libretools +print() { + fmt=$1; shift + printf -- "$fmt\n" "$@" +} + cmd=${0##*/} usage() { + . libremessages print 'Usage: . $(%s LIBRARY)' "$cmd" print "Finds a shell library file" echo print "While some libraries can be sourced just by their name because" print "they are installed in PATH (like libremessages), some are not" - print "installed there (like conf.sh), so path must be given." + print "installed there (like conf.sh), so a path must be given." print "Hardcoding that path is the way of the dark side." echo print "By default, it looks for the files in '%s'," "$default_libdir" @@ -39,6 +45,10 @@ main() { usage >&2 return 2 fi + if [[ $1 == '-h' ]]; then + usage + return 0; + fi if [[ -z $LIBRETOOLS_LIBDIR ]]; then export LIBRETOOLS_LIBDIR=$default_libdir -- cgit v1.2.2