pkgdb has been put into read-only mode,
so it won't be updated for new Fedora releases
going forward. Use apps.fedoraproject.org/packages instead.
Signed-off-by: Bob W. Hogg <rwhogg@linux.com>
Use GitHub's code search API to search using the filename based on the
search query. This means we only need a single HTTP call and no more
multithreading madness. This also means we're able to search everything
in the Homebrew and Caskroom organisation by default without having to
maintain a list of things to search (and not) in here.
Before this change:
```
~> brew search openssl@1.1
openssl@1.1 ✔
==> Did you mean to perform a regular expression search?
==> Surround your query with /slashes/ to search by regex.
```
`any?` is not the opposite of `empty?`. Besides the case that
`[false, nil].any?` will return false, `any?`(O(n)) has much worse
performance than `empty?`(O(1)).
Amends 132ada2b0ebb3751c0f8f42ca83bb257b55a50fd until we properly figure
out a way of documenting built-in aliases (or not doing that) across all
commands that currently have aliases. See #270 for full discussion.
* Include --desc in brew search help text.
* Update brew search --desc text in README.
* Remove mention of alias in brew search help text to avoid any
confusion.
* Move listing all formula names in the top to speed up shell script.
* Simplify logic.
* Only search PR and check bad regex for tty?, which will benefit to
shell script.
ClosesHomebrew/homebrew#44985.
Signed-off-by: Xu Cheng <xucheng@me.com>
By directly modifying the results array with
`results[i] = "#{name} (installed)"`, it appeared on successive
iterations that the canonical name was no longer in the array, so
aliases were not removed.
See 9efe5b554c (commitcomment-12969631)ClosesHomebrew/homebrew#43433.
`brew search emacs`, with homebrew/emacs tapped:
```
real 0m2.586s
user 0m1.138s
sys 0m0.121s
```
Previously:
```
real 0m2.831s
user 0m1.385s
sys 0m0.087s
```
`brew search s`:
```
real 0m2.260s
user 0m1.201s
sys 0m0.114s
```
Previously:
```
real 0m5.953s
user 0m4.827s
sys 0m0.226s
```
ClosesHomebrew/homebrew#35696.
ClosesHomebrew/homebrew#42662.