mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™. The command used to reprocess everything is: ```shell shfmt -l -bn -ci -i 2 -w . ```
40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
fn-logs-usage() {
|
|
declare desc="logs specific usage"
|
|
echo "Usage: dokku logs <app>"
|
|
echo " display recent log output"
|
|
echo ""
|
|
echo " -n, --num NUM # the number of lines to display"
|
|
echo " -p, --ps PS # only display logs from the given process"
|
|
echo " -t, --tail # continually stream logs"
|
|
echo " -q, --quiet # display raw logs without colors, time and names"
|
|
}
|
|
|
|
fn-logs-help-content() {
|
|
declare desc="return logs plugin help content"
|
|
cat <<help_content
|
|
logs <app> [-h] [-t] [-n num] [-q] [-p process], Display recent log output
|
|
logs:failed <app>, Show the last logs for an application
|
|
help_content
|
|
}
|
|
|
|
cmd-logs-help() {
|
|
if [[ $1 == "logs:help" ]]; then
|
|
echo -e 'Usage: dokku logs[:COMMAND]'
|
|
echo ''
|
|
echo 'Output app logs'
|
|
echo ''
|
|
echo 'Additional commands:'
|
|
fn-logs-help-content | sort | column -c2 -t -s,
|
|
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
|
|
fn-logs-help-content
|
|
else
|
|
cat <<help_desc
|
|
logs, Output app logs
|
|
help_desc
|
|
fi
|
|
}
|