Files
commafeed-podcasts/bs/.common
T
2026-06-11 15:04:57 +02:00

25 lines
444 B
Bash

#!/usr/bin/env bash
# depends on
declare -r readme='bs/README.md'
isHelp() {
for arg in "$@"; do
[[ "$arg" == '-h' || "$arg" == '--help' ]] && return 0
done
return 1
}
echoReadmeInfo() {
local -r script="bs/${0##*bs/}"
local info
if ! info="$(grep -A1 "## $script" "$readme" | tail -n1)"; then
info="No info found in $readme for $script"
fi
cat <<-EOF
$info
Usage: $script [options]
Options:
-h, --help: Show this help
EOF
}