Issy Long 8881ea74b5
cli/parser: Don't treat args with --cask as formulae
- For the command `brew install --cask racket`, a user was reporting the
  behaviour where despite `--cask` in the command, they were getting
  output about the `racket` formula having been renamed:

```
$ brew install --cask racket
Warning: Use minimal-racket instead of deprecated racket
==> Downloading https://mirror.racket-lang.org/installers/8.7/racket-8.7-x86_64-macosx-cs.
==> Installing Cask racket
[...]
racket was successfully installed!
```

- The "instead of deprecated ..." messaging comes from the `TapLoader`
  class `formula_name_path` method, so _something_ must be assuming
  that everything is initially a formula before _later_ learning from
  further args parsing that there's a `--cask` qualifier to scope to
  only casks.

- There are always `@formula_options` and args parsing is recursive,
  going through each option, so we check that the original `argv` items
  include a `--cask` and skip calling the `formulae` method if that's
  the case.

- After this change, the "formula renames" words no longer show up.

```
$ brew install --cask racket
==> Downloading https://mirror.racket-lang.org/installers/8.7/racket-8.7-aarch64-macosx-cs.dmg
==> Installing Cask racket
[...]
racket was successfully installed!
```
2023-01-27 21:49:20 +00:00
..
2023-01-06 02:46:21 -05:00
2022-08-23 11:25:02 +01:00
2022-12-01 00:17:04 +00:00
2023-01-26 21:18:24 -08:00
2023-01-25 16:05:02 +00:00
2022-11-30 03:50:38 +00:00
2023-01-27 00:30:13 +00:00
2022-10-24 19:42:49 +01:00
2023-01-26 21:18:24 -08:00
2023-01-02 19:18:51 +00:00
2023-01-26 21:24:50 +01:00
2023-01-26 18:06:04 +00:00
2023-01-26 22:08:40 -08:00
2023-01-06 02:46:21 -05:00
2022-11-11 16:16:54 -05:00
2023-01-02 19:18:51 +00:00
2022-08-23 12:42:02 +01:00
2023-01-24 21:45:18 +09:00
2023-01-02 19:18:51 +00:00
2023-01-25 10:07:42 -08:00
2022-12-13 11:37:06 +00:00
2023-01-02 19:18:51 +00:00
2022-11-06 22:50:07 -05:00
2022-11-08 21:11:10 +09:00
2022-08-13 23:30:20 -10:00
2023-01-19 12:40:50 -05:00
2022-11-06 22:50:07 -05:00
2022-12-13 11:37:06 +00:00
2022-12-23 19:36:13 +01:00
2022-09-14 22:23:01 -04:00
2022-09-08 01:44:31 +01:00

Homebrew Ruby API

This is the API for Homebrew.

The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.

You may also find the Formula Cookbook and Ruby Style Guide helpful in creating formulae.

Good luck!