From: Alexander Barton Date: Wed, 24 May 2023 10:13:46 +0000 (+0200) Subject: homebrew: SHow command info for no args, "doctor" and "dr" sub-commands X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83aa52fc828392e74beffe94cfb0d2c1d1f1c35c;p=ax-zsh.git homebrew: SHow command info for no args, "doctor" and "dr" sub-commands --- diff --git a/plugins/homebrew/homebrew.zshrc b/plugins/homebrew/homebrew.zshrc index b6af123..379eae9 100644 --- a/plugins/homebrew/homebrew.zshrc +++ b/plugins/homebrew/homebrew.zshrc @@ -52,8 +52,9 @@ function brew() { cd /tmp user="$(/bin/ls -ld "$HOMEBREW_REPOSITORY" | awk '{print $3}')" group="$(/bin/ls -ld "$HOMEBREW_REPOSITORY" | awk '{print $4}')" - [[ $# -eq 0 && -t 1 ]] \ - && echo "Running \"$real_brew_cmd\" as user \"$user:$group\" ..." + if [[ $# -eq 0 || "$1" = "doctor" || "$1" = "dr" ]]; then + echo "Running \"$real_brew_cmd\" as user \"$user:$group\" ..." + fi sudo -u "$user" -g "$group" -- sh -c "$priv_exec" ) fi