1
0
Fork 0
mirror of https://github.com/overleaf/toolkit.git synced 2025-04-19 23:38:06 +02:00

Add help to error-logs command

This commit is contained in:
Shane Kilkelly 2020-06-10 09:38:11 +01:00
parent f42a52d36d
commit 61abb59cec

View file

@ -2,7 +2,35 @@
set -euo pipefail
function usage() {
echo "Usage: bin/error-logs [OPTIONS] [SERVICES...]"
echo ""
echo "Services: chat, clsi, contacts, docstore, document-updater,"
echo " filestore, notifications, real-time, spelling,"
echo " tags, track-changes, web"
echo ""
echo "Options:"
echo " -f follow log output"
echo " -n {number} number of lines to print (default 20)"
echo ""
echo "Examples:"
echo ""
echo " bin/error-logs -n 50 web clsi"
echo ""
echo " bin/error-logs -f web"
echo ""
echo " bin/error-logs -f web chat docstore"
echo ""
echo " bin/error-logs -n 100 -f filestore "
echo ""
echo " bin/error-logs -f"
}
function __main__() {
if [[ "${1:-null}" == "help" ]] || [[ "${1:-null}" == "--help" ]]; then
usage
exit
fi
# preserve the '==>' labels from tail output
bin/logs "$@" | grep -E '(^==>.*$|^.*level":50.*$)' --color=never
}