65 Commits

Author SHA1 Message Date
Misty De Meo
6542b22677 brew-test-bot: move html and css into subdirectory
Also updates the bash-completion to ignore subdirectories, rather than
specific filename patterns.
2012-07-18 08:25:07 -05:00
Misty De Meo
615c15937e bash-completion: hide brew-bot support files
Hides files with the extensions ".css" and ".erb" to ensure that the
brew-bot's support files don't show up in tab-completion.
2012-07-17 23:29:28 -05:00
Jack Nagel
d4a37c673e Restore completion for "link" and "ln"
Commit 3b5d7939d9a660a83e29a86e6bab234f3e9f2dcb added completion for
`brew link` options, but disabled completion of the actual command
itself.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-12 02:41:12 -05:00
Adam Vandenberg
e0b8531bc7 Add completions for brew link 2012-07-11 20:08:09 -07:00
Jack Nagel
ec0a6ee251 Completion for "brew missing"
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-13 08:14:25 -05:00
Jack Nagel
644af3696b Use "legacy" search API when completing tap names
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-06-12 11:58:48 -05:00
Misty De Meo
7af4622b0f Replace /usr/bin/ruby with full Framework path
Rationale: some users insist on replacing the /usr/bin/ruby symlink
to point to another ruby on their system, which may break homebrew.
Use the full Framework path instead, which is less likely to be tampered with.

This also reorganizes the brew --config checks to reflect the different path.

Fixes Homebrew/homebrew#12009.

Closes Homebrew/homebrew#12333.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-06-01 09:24:25 -05:00
Jack Nagel
7706e1210f 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 <jacknagel@gmail.com>
2012-03-29 20:11:00 -05:00
Jack Nagel
53481dc14a Tab completion for brew tap
Using an inline Ruby script we can hit the GitHub API and look for
repositories that match the tap naming scheme. The results are cached
for the duration of the current shell session, so going over the network
is a once-per-shell-session cost.

There are a few false positives, but not much we can do about that at
this point, as taps do not have to be in the fork network of any
specific repository.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-23 22:42:43 -05:00
Mike McQuaid
e33937a1e3 Rename external commands directory from examples.
Fixes Homebrew/homebrew#10829.
2012-03-18 15:34:41 +13:00
Jack Nagel
2ed0240cb1 Tab completion for tapped formulae
So you can do e.g.

    $ brew install adamv<TAB>
    Display all 106 possibilities? (y or n)
    $ brew install adamv/alt/openss<TAB>
    adamv/alt/openssh     adamv/alt/openssl098  adamv/alt/openssl100

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-03-16 19:18:58 -05:00
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