blob: 1df0c39880e438fdb84287737896f5bc820406da (
plain) (
tree)
|
|
#!/bin/sh
set -eu
usage() {
cat <<-'EOF'
Usage:
collections
collections -h
EOF
}
help() {
cat <<-'EOF'
Options:
-h, --help show this message
List the registered collections to STDOUT.
This is done by emiting the content of the "$COLLECTIONS"
environment variable.
Examples:
Just run it:
$ collections
tils
pastebins
EOF
}
for flag in "$@"; do
case "$flag" in
--)
break
;;
--help)
usage
help
exit
;;
*)
;;
esac
done
while getopts 'h' flag; do
case "$flag" in
h)
usage
help
exit
;;
*)
usage >&2
exit 2
esac
done
shift $((OPTIND - 1))
echo "$COLLECTIONS" |
tr ' ' '\n' |
grep .
|