104 Commits

Author SHA1 Message Date
Jack Nagel
ee0041f290 Appease the masses
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 19:18:54 -05:00
Jack Nagel
bbb212f41e Bash completion for brew untap
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 16:52:35 -05:00
Jack Nagel
ba69e17073 Refactor the bash completion script
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>
2012-01-25 23:04:08 -06:00
Jack Nagel
7423b79f3a Complete options for brew -S
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-08 13:24:35 -06:00
Jack Nagel
f3f04e595d versions: enable '--compact' output
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>
2012-01-06 14:51:15 -06:00
Jack Nagel
3f76af69d3 completion: audit takes formula arguments
- Also remove `--strict` completion since that option was removed.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-12-11 01:49:47 -06:00
Jack Nagel
e4bed29e99 completion: complete multiple formula arguments
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>
2011-12-11 01:49:47 -06:00
Jack Nagel
093974f200 Document 'install --devel'
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-28 14:43:54 -06:00
Jack Nagel
8b88ea3eae Move brew-depstree into brew deps --tree
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-27 23:29:41 -06:00
Charlie Sharpsteen
33a61d1897 Add --fresh option to brew install
When invoked, this option will ensure brew doesn't re-use any options from
previous installs of a formula.
2011-11-14 10:44:18 -08:00
Jack Nagel
0474fa11cd completion: add __brew_ps1 to annotate $PS1
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>
2011-11-11 00:01:05 -06:00
Jack Nagel
4da0b506f4 Add bash completion for subcommand options
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>
2011-10-12 02:57:28 -05:00
Jack Nagel
558ce2dd3d Fix syntax error in the bash-completion script
My bad.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-09 13:40:49 -05:00
Jack Nagel
cc7efdc94d Make bash completion for upgrade smarter
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-08 20:30:10 -05:00
Jack Nagel
864c81a61b Fix alpha-order mistake in brew bash-completion
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-08-29 10:31:45 -05:00
Jack Nagel
dde71e97e7 Add upgrade to the bash-completion script
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-08-28 14:12:53 -05:00
Jack Nagel
b42052b279 Document HOMEBREW_BUILD_FROM_SOURCE
Additionally, add '--build-from-source' to the bash-completion script.
2011-08-25 00:08:30 -05:00
Charlie Sharpsteen
8a1bcf70a1 Contribution: Tweak bash completion for install
Selection of generic installation options, such as `--HEAD`, is now lumped
together with selection of formulae-specific options.

This allows any installation option to be tab-completed *before or after* the
formula name is specified.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-08-17 23:23:20 -07:00
Sebastian Staudt
6726fe090f Added new command "versions" 2011-08-02 10:35:30 +01:00
Adam Vandenberg
153c1c759b Add --use-clang to completion script. 2011-06-16 20:58:06 -07:00
Adam Vandenberg
dae5a4477b Add remove back to completion 2011-05-14 10:16:52 -07:00
Jack Nagel
d88b562926 Update bash completion script
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-05-04 19:23:39 -07:00
Adam Vandenberg
94a524cce3 brew missing: allow a formula argument
If a formula is given, it will be checked for missing deps.
The formula does not have to be installed first.

Without a formula list, still checks all installed brews.
2011-04-13 13:48:31 -07:00
Adam Vandenberg
78ace67b3f Add audit to bash completion 2011-03-31 11:09:45 -07:00
Adam Vandenberg
8556961034 add --verbose to brew install completion 2011-03-21 12:42:10 -07:00
Adam Vandenberg
e68a4d3e37 Add --use-gcc to bash completion 2011-03-16 16:31:39 -07:00
Justin Hileman
c6e78260e7 Handle default install --options
i.e. `--force --debug --use-llvm --ignore-dependencies --HEAD`

Additionally:

 * Use a cleaner `if` block in install options completion case.
 * De-dupe options for subsequent completion (e.g. stop offering --foo once
   --foo option has been used).

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-02-09 17:44:01 -08:00
Adam Vandenberg
6864140237 brew --compact 2011-02-04 16:52:46 -08:00
Justin Hileman
97b8f9a31f bash completion: --options for brew install foo
To trigger the option autocompletion, type:

    brew install foo --[tab][tab]

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-02-04 16:46:04 -08:00
Adam Vandenberg
d501b256e5 add test to completion 2010-10-07 20:27:12 -07:00
Adam Vandenberg
8b8bf79315 Some people alias 'ls' so escape it in bash completion 2010-10-01 07:07:46 -07:00
Adam Vandenberg
9eea5bd447 Update Bash completion script
* Add external command completion
* Add alias completion
2010-08-07 18:08:54 -07:00
Adam Vandenberg
22ec3c76a8 Add some dash-commands to bash completion script 2010-06-09 22:01:13 -07:00
Adam Vandenberg
d9dd462309 Remove 'generate' from bash completion. 2010-06-07 14:15:45 -07:00
Adam Vandenberg
b0bc592e17 Tweak the bash completion script.
* Add --config
* Alphabetize various lists
* Remove some local temp variables
2010-05-30 13:00:51 -07:00
Adam Vandenberg
b23ae3688c Add doctor to bash completion. 2010-04-06 08:22:28 -07:00
Adam Vandenberg
97b66ea1de Add log to bash completions. 2010-03-19 11:56:11 -07:00
Adam Vandenberg
1ade7ef4e0 Update bash completions
* Bring command list up-to-date
* Subcommand completion now ignores switches
2010-02-27 19:33:10 -08:00
Adam Vandenberg
43dc7c9645 deps was missing from bash completion 2010-01-30 23:50:09 -08:00
Max Howell
3bf6c5f9c9 Document brew cleanup 2010-01-18 08:36:10 +00:00
Adam Vandenberg
9dc39c391a Some bulletproofing for bash completion script.
Since Homebrew's Library doesn't have to be linked under prefix,
we need to do some extra work in the bash completion script to
support this configuration.

Added a "--repository" option to brew, and updated the completion
script to use paths relative to this location.
2010-01-16 15:33:32 +00:00
Adam Vandenberg
56f82a33b1 Update bash and zsh for 'uses'. 2009-11-19 14:03:07 -08:00
Adam Vandenberg
1e3dff7b8e Update bash completions. 2009-09-25 18:58:06 +01:00
Max Howell
fc52e1a69d brew make' becomes brew create'
This is because I have observed two people confuse make with the "make" tool
and thus assume `brew make' is `brew install'.

`brew make' will be deprecated at 0.7, until then it shows a warning.
2009-09-07 01:34:40 +01:00
Max Howell
de620e4396 No spurious error due to Interrupt during curl
Only delete the file that is downloaded if an error occurs while downloading it.
2009-09-05 20:47:15 +01:00
Max Howell
e7594de797 Allow configure alias for diy 2009-08-24 01:04:53 +01:00
Max Howell
140bfc5592 brew diy command
Automagically determines prefix to install to for DIY installations.

README amended.
2009-08-12 13:43:51 +01:00
Max Howell
760c083c0c Refactor
Large refactor to Formula, mostly improving reliability and error handling but
also layout and readability.

General improvements so testing can be more complete.

Patches are automatically downloaded and applied for Formula that return a
list of urls from Formula::patches.

Split out the brew command logic to facilitate testing.

Facility from Adam Vandenberg to allow selective cleaning of files, added
because Python doesn't work when stripped.
2009-08-10 18:11:17 +01:00
Adam Vandenberg
bfa17cc16c Homepage takes any formula, installed or not.
Signed-off-by: Max Howell <max@methylblue.com>
2009-08-04 07:48:26 +08:00
Adam Vandenberg
a734b30a68 Add home(page) to completion.
Signed-off-by: Max Howell <max@methylblue.com>
2009-08-03 08:13:30 +08:00