If HOMEBREW_KEEP_INFO environment variable is set:
- Do not symlink the info directory file (aka 'share/info/dir')
otherwise it gets overwritten by next installed brew.
- Install an entry in the directory for each linked info file when the
brew is linked.
- Uninstall the entry when the brew is unlinked.
ClosesHomebrew/homebrew#9700.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
The script was lacking structure and had grown a number of one-off hacks
that would be better as reusable functions. So,
- give each subcommand that has completions it's own function
- move completion of formulae, installed brews, and outdated brews into
reusable functions
- introduce a general __brewcomp() function that takes a string of tab,
space, and/or newline separated items and converts all seperators to
newlines, and then generates a reply with compgen().
These changes should allow for easier addition of new features in the
future.
As a bonus, completion for `brew log` will include git-log options if
the git completion script is also loaded.
_brew_to_completion() is kept around for compatiblity.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This will be useful for shell tab completion when something like `brew
install <formula> --version <version>` is implemented.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
We make the assumption that the first non-option word is the command
being invoked.
Originally I was trying to allow command completion for non-standard
command lines like
$ brew --verbose inst<TAB>
but right now executing something like that doesn't actually work. Which
is interesting, because the man page implies that it should. Either the
man page is incorrect, or something was broken between then and now.
Anyway, it would probably be safe to just assume that COMP_WORDS[1] is
the command, and we do make that assumption in other places. But if we
ever do allow things like "brew --option command", this will be useful.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
When investigating issues, one might want to see exactly what curl is
doing behind the scenes. Setting HOMEBREW_CURL_VERBOSE will cause the
'--verbose' flag to be passed to all invocations of curl.
Prompted by Homebrew/homebrew#8992.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
It is often useful to be reminded that you are, in fact, in the middle
of a debug or interactive install. We provided this reminder in the form
of HOMEBREW_DEBUG_INSTALL, but we can make this even easier for the end
user to consume by exposing it in the form of a shell function.
When HOMEBREW_DEBUG_INSTALL is set, the __brew_ps1() function returns
the string "(formula_name|DEBUG)" by default (much like the __git_ps1()
output when performing some long-running operation, e.g.
"(branch|REBASE-i)". The formatting around "formula_name|DEBUG" can be
customized by passing a format string to the function.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Sometimes you want to know what `brew cleanup` will do before it
actually removes anything. Introduce a '-n' option (chosen to match
other UNIX tools) to do this.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
brew-unpack was failing for formulae that satisfy fails_with_llvm? as
handle_llvm_failure() requires our ENV extension to get ENV.compiler.
Rather than requiring extend/ENV, just define fails_with_llvm? as false
since we don't really care about that when just unpacking a formula.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
We already have option completion for `brew install`; now we have it for
all core commands, and the --cache, --cellar, and --prefix flags now
have appropriate formula completion.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Per mxcl/homebrew@6b0c44d, @mxcl:
"And in that mind, brew missing is some cases an essential tool and
should absolutely be in the manpage."
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
The documentation on this is hard to find, and awareness of the command
itself is pretty low. Which is too bad, because it's really handy and I
use it all the time myself.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
While updating the bash completion script, I encountered some options
that were previously undocumented.
I purposely did not document the --macports and --fink flags for `brew
create`, because the exact same functionality exists in `brew search`.
Perhaps we should remove it from create.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
It was extraneous, and useful only for maintainers and contributors. It
is currently documented on the External Commands page of the wiki.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
In addition to a brief overview of what external commands are, add a
link to the wiki page where the real documentation resides.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Commit 00cd16f changed oudated_brews to return a list of Formula
objects rather than a list of lists containing formula information.
Now we must access the formula name by using the 'name' accessor rather
than an array index.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`brew-unpack` now runs `Formula.brew` and copies the stage directory to the
unpack location. This provides two improvements:
- Patches may be applied. The `patch` metho of the Formula class is
overloaded such that patches are only applied if the `--patch` option is
passed to `brew unpack`.
- Formula can respond better to flags passed by `ARGV`.
Some trickery is pulled to ensure `DATA` is correctly set for each unpacked
formula.
`brew options --installed` will print options for formulae that are
already installed.
ClosesHomebrew/homebrew#7565.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Document the '--versions' option for `brew list`.
The two forms of the `list` command as previously documented clearly do
different things, but after documenting '--versions', their functions do
overlap a bit, so we combine them and clarify the different invocations.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
- Remove unnecessary linefeeds above "ENVIRONMENT"
- Use the word "example" rather than "sample" to be more consistent
throughout the documentation
Signed-off-by: Jack Nagel <jacknagel@gmail.com>