From 83aa52fc828392e74beffe94cfb0d2c1d1f1c35c Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 24 May 2023 12:13:46 +0200 Subject: [PATCH] homebrew: SHow command info for no args, "doctor" and "dr" sub-commands --- plugins/homebrew/homebrew.zshrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.39.2