Skip to content

Commit

Permalink
Remove "__brew_ps1" function from completion
Browse files Browse the repository at this point in the history
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 <jacknagel@gmail.com>
  • Loading branch information
jacknagel committed Mar 30, 2012
1 parent 46e85b5 commit ffb9aa5
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions Library/Contributions/brew_bash_completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<formula_name>|DEBUG) $
#
# You can customize the output string, e.g. $(__brew_ps1 "[%s]") would
# output "[<formula_name>|DEBUG]". The default (if you do not provide a
# format argument) is to print "(<formula_name>|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 ()
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ffb9aa5

Please sign in to comment.