From 7706e1210f8a4c284d64f605f5032a20ffd89d9b Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 29 Mar 2012 19:59:35 -0500 Subject: [PATCH] Remove "__brew_ps1" function from completion This was probably silly and I'm probably the only person that ever used it. I still do, actually, but it's not really a completion function, it's simple enough to just stick in a shell startup script, and removing it makes the completion script usable under the new dynamic loading scheme provided by bash-completion 1.99+. Signed-off-by: Jack Nagel --- Library/Contributions/brew_bash_completion.sh | 34 +++---------------- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/Library/Contributions/brew_bash_completion.sh b/Library/Contributions/brew_bash_completion.sh index 7faaf9e936..6261f7749a 100644 --- a/Library/Contributions/brew_bash_completion.sh +++ b/Library/Contributions/brew_bash_completion.sh @@ -10,30 +10,10 @@ # $(brew --prefix)/etc/bash_completion.d # $(brew --prefix)/share/bash-completion/completions # -# and bash-completion will source it automatically. -# -# The __brew_ps1() function can be used to annotate your PS1 with -# Homebrew debugging information; it behaves similarly to the __git_ps1() -# function provided by the git's bash completion script. -# -# For example, the prompt string -# -# PS1='\u@\h \W $(__brew_ps1 "(%s)") $' -# -# would result in a prompt like -# -# user@hostname cwd $ -# -# but if you are currently engaged in an interactive or debug install, -# (i.e., you invoked `brew install` with either '-i' or '-d'), then the -# prompt would look like -# -# user@hostname cwd (|DEBUG) $ -# -# You can customize the output string, e.g. $(__brew_ps1 "[%s]") would -# output "[|DEBUG]". The default (if you do not provide a -# format argument) is to print "(|DEBUG)" prefixed with a -# single space. +# Installing to etc/bash_completion.d will cause bash-completion to load +# it automatically at shell startup time. If you choose to install it to +# share/bash-completion/completions, it will be loaded on-demand (i.e. the +# first time you invoke the `brew` command in a shell session). __brewcomp_words_include () { @@ -375,12 +355,6 @@ _brew_versions () __brew_complete_formulae } -__brew_ps1 () -{ - [[ -n $HOMEBREW_DEBUG_INSTALL ]] && - printf "${1:- (%s)}" "$HOMEBREW_DEBUG_INSTALL|DEBUG" -} - _brew () { local i=1 cmd