36 Commits
Author SHA1 Message Date
EricFromCanada b71644e735 Update Shell-Completion.md 2021-12-02 22:59:00 -05:00
EricFromCanada 77efcdf8fb Add & remove line breaks 2021-12-02 22:58:31 -05:00
XuehaiPan 3f96d963f7 style: fix inconsistent code style for shell scripts 2021-09-15 14:59:01 +08:00
David BaileyandGitHub 39cdf234a2 Remove diff formatting (keep only relevant line) + clarify to append the line after initialization 2021-01-20 15:30:03 +00:00
a04b4890a9 Remove unneeded export
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-01-20 15:24:51 +00:00
David BaileyandDavid Bailey 5bb1556246 Suggest alternative method for enabling ZSH completions 2021-01-20 12:28:49 +00:00
Rylan Polster e7b369273a completions: link official taps automatically 2021-01-11 12:27:57 -05:00
Rylan Polster 74787ca0ee docs: update shell completions instructions 2021-01-08 11:26:33 -05:00
Zachary MoonandGitHub 8dcd2d2ba8 Add a missing backtick 2021-01-02 13:38:31 -05:00
Hoàng Xuân PhúandGitHub 9725e85357 chmod recursively to satisfy zsh "insecure directories" warning
without `-R` only `share` is updated, leaving `share/zsh/site-functions` unchanged, so the warning won't go away
2020-09-18 11:27:39 -04:00
c94196c073 Brevity
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-07-21 12:49:00 +04:00
f7580f109e Answer what profile file should be used clearer
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-07-21 12:45:45 +04:00
Ishan GoelandGitHub a613c1acd2 Make stuff clearer, grammar stuff. 2020-07-21 06:22:44 +04:00
Ishan GoelandGitHub 5a992f1194 Remove quoted completion one-liner 2020-07-21 06:18:20 +04:00
Ishan GoelandGitHub 4872d6653f Recommend bash-completion unless user has newer bash 2020-07-20 18:24:01 +04:00
f9d77c9d89 Clarify which file the completion code should be added to
Co-authored-by: Shaun Jackman <sjackman@gmail.com>
2020-07-16 21:11:35 +04:00
Ishan GoelandGitHub 7115427e78 Recommend commenting out the formula Caveats code 2020-07-16 18:03:51 +04:00
Ishan GoelandGitHub 9ae1c1aafa Make Shell-Completion.md clearer and update it 2020-07-16 14:21:15 +04:00
Adrian HoandGitHub 125ed8cf93 Update Shell-Completion.md 2020-07-03 20:24:50 +08:00
Adrian HoandGitHub 7f651de7be Add completion configuration for non-Homebrew fish
Tested on Ubuntu 18.04 LTS
2020-07-03 19:28:45 +08:00
Shaun Jackman 133ee7966d shell: Use .profile unless .bash_profile exists 2020-05-13 09:30:02 -07:00
Kreig Zimmerman 6902073984 docs(Shell-Completion.md): modified conditional for .zshrc to include call to compinit 2020-02-21 17:28:24 -05:00
Andy Lester 953a1bf20b Add quotes around the brew invocation 2019-10-11 08:51:43 -05:00
Andy LesterandGitHub c296c5f2d3 bash completion should not call brew if brew doesn't exist
In the section "Configuring Completions in `bash`", there's a line of code that sets `HOMEBREW_PREFIX` by calling `brew --prefix`, but it's done before calling `type brew` to see if brew exists.  This gives a "-bash: brew: command not found" if you don't have brew installed. That line should be moved inside the `if`.
2019-10-02 09:00:23 -05:00
Lawrence 109d2a6d0e Deleted comment in parentheses 2019-09-07 18:21:01 -04:00
Lawrence 994d92ab32 Fixed website documentation to mark that brew provides fish completions 2019-09-07 17:26:15 -04:00
EricFromCanada 56263791c8 docs: account for bash-completion in suggested script
This runs the `bash-completion` initialization script if available, and loads each file in `{etc}/bash_completion.d` otherwise.
2019-07-24 15:54:07 -04:00
Matthew RothenbergandGitHub 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 McQuaidandGitHub 439283c3df Shell-Completion: recommend .bash_profile
`.bashrc` is not the right location for shell completions.
2019-03-30 10:01:16 +00:00
Mike McQuaidandGitHub 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 AndolinaandGitHub 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 SchneemanandGitHub 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