summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/librelib12
1 files changed, 11 insertions, 1 deletions
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