feat: ensure the dokku binary respects the quiet flag

Previously, there were many headers being output that were unable to be removed via the --quiet flag.
This commit is contained in:
Jose Diaz-Gonzalez
2018-04-27 03:55:00 -04:00
parent 3ce148dacd
commit a6b047805c
2 changed files with 19 additions and 12 deletions

24
dokku
View File

@@ -191,20 +191,20 @@ case "$1" in
done
# New lines are blank echos for readability
echo "Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]"
echo ""
echo "Primary help options, type \"dokku COMMAND:help\" for more details, or dokku help --all to see all commands."
echo ""
echo "Commands:"
echo ""
dokku_log_quiet "Usage: dokku [--quiet|--trace|--rm-container|--rm|--force] COMMAND <app> [command-specific-options]"
dokku_log_quiet ""
dokku_log_quiet "Primary help options, type \"dokku COMMAND:help\" for more details, or dokku help --all to see all commands."
dokku_log_quiet ""
dokku_log_quiet "Commands:"
dokku_log_quiet ""
if [[ "$2" == "--all" ]] ; then
for core_plugin_command in $CORE_PLUGIN_COMMANDS; do
$core_plugin_command help
done | sort | column -c2 -t -s,
echo ""
echo "Community plugin commands:"
echo ""
dokku_log_quiet ""
dokku_log_quiet "Community plugin commands:"
dokku_log_quiet ""
for community_plugin_command in $COMMUNITY_PLUGIN_COMMANDS; do
$community_plugin_command help
done | sort | column -c2 -t -s,
@@ -214,9 +214,9 @@ case "$1" in
# When done, sort, sed cuts arugments out of strings and colum make it pretty
done | sort | sed -e '/^.*:/d' -e 's/\s[\[\<\-\(].*,/,/' | column -c2 -t -s,
if [[ -n "$COMMUNITY_PLUGIN_COMMANDS" ]]; then
echo ""
echo "Community plugin commands:"
echo ""
dokku_log_quiet ""
dokku_log_quiet "Community plugin commands:"
dokku_log_quiet ""
for community_plugin_command in $COMMUNITY_PLUGIN_COMMANDS; do
$community_plugin_command help
done | sort | column -c2 -t -s,

View File

@@ -16,6 +16,13 @@ dokku_apps() {
[[ $INSTALLED_APPS ]] && echo "$INSTALLED_APPS"
}
dokku_log_quiet() {
declare desc="log quiet formatter"
if [[ -z "$DOKKU_QUIET_OUTPUT" ]]; then
echo "$*"
fi
}
dokku_log_info1() {
declare desc="log info1 formatter"
echo "-----> $*"