9 Commits

Author SHA1 Message Date
Matthew Rothenberg
dc30e9f64d
speedup bash completion loading suggestion in docs
The current suggestion for users shells out to `brew --prefix` three separate times, which has a non-zero overhead (as per quick benchmark below, approx 20ms per invocation). By making a minor change, the first invocation can be stored in a local variable to reduce shell startup time.

```
$ hyperfine --warmup=3 'brew --prefix'       
Benchmark #1: brew --prefix
  Time (mean ± σ):      21.3 ms ±   1.5 ms    [User: 8.8 ms, System: 10.6 ms]
  Range (min … max):    20.3 ms …  37.0 ms    128 runs
```
2019-05-07 12:36:02 -04:00
Mike McQuaid
439283c3df
Shell-Completion: recommend .bash_profile
`.bashrc` is not the right location for shell completions.
2019-03-30 10:01:16 +00:00
Mike McQuaid
ea379a84a6
Shell-Completion: fix redirection.
Fixes the issue noted in https://github.com/Homebrew/brew/pull/5625.
2019-02-21 16:25:47 +00:00
Mike McQuaid
f8c574bbc0
docs/Shell-Completion: read both types of bash completions.
And guard against either of them being missing.

Fixes #5610
2019-01-28 16:36:07 +00:00
Ian Max Andolina
030ddc9762
Update Shell-Completion.md
Please see https://discourse.brew.sh/t/bash-completion-and-brew-instructions-for-setting-up-completions/3808 for details...
2019-01-09 09:08:32 +08:00
Richard Schneeman
1dcf8c689c
Update bash completion docs
When I try to run the proposed script in my `~/.bashrc` file I get this output:

```
-bash: have: command not found
-bash: have: command not found
-bash: have: command not found
-bash: have: command not found
-bash: have: command not found
-bash: have: command not found
-bash: have: command not found
-bash: have: command not found
-bash: have: command not found
-bash: have: command not found
-bash: [: =: unary operator expected
# ...
```

It goes on for quite some time and does not give me bash completion.

When I execute `source "$(brew --prefix)/etc/bash_completion"` it works and I get bash completion.

This script also emits a helpful error message letting people know if bash completion was not installed already.

I'll also add that the bash completion script takes a fairly long amount of time. I've seen between one quarter and a half of a second to execute it:

```
$ time source "$(brew --prefix)/etc/bash_completion"

real	0m0.254s
```

Though that's unrelated to this PR, making a note of it.
2018-12-06 12:04:08 -06:00
EricFromCanada
31dbc4f985 Various documentation edits
Mostly edits to formatting, grammar, wording for consistency & readability.
2018-10-05 17:23:22 -04:00
Mike McQuaid
c1376f9f18
docs: various updates.
I read through the docs locally and made various fixes.
2018-09-06 15:07:00 +01:00
Andrew Janke
36e961ad98 Doco: add a Shell Completion doc
This describes how to configure your shell to use Homebrew-managed completion
definitions. Needed because this is a manual step the user has to do.
2018-05-22 08:11:31 -04:00