104 Commits

Author SHA1 Message Date
Markus Reiter
45066f9144 Fix uninstall --force for casks. 2021-03-24 13:32:58 +01:00
Bo Anderson
8e98ce69f3
Stricter handling of CLI args 2021-03-18 16:41:57 +00:00
nandahkrishna
585ec90878
cask_loader: do not auto-tap in FromTapLoader 2021-03-11 21:09:42 +05:30
hyuraku
efd4138c8e cli/named_args: refactor if statements 2021-03-01 09:10:26 +09:00
Seeker
1ce8bd00fb named_args: print error if formula and cask found but one is unreadable 2021-01-28 15:21:23 -08:00
Seeker
89930157b5 named_args: raise rescued error if both formula/cask are unreadable 2021-01-28 15:21:23 -08:00
Seeker
7863879145 named_args: raise error if formula/cask is found but unreadable 2021-01-25 11:49:27 -08:00
Rylan Polster
64816651d0
Only tap homebrew/cask on CaskUnavailableError in brew install 2021-01-20 12:22:31 -05:00
Seeker
fbafaff4fe rubocop: require braces for Sorbet sig 2021-01-18 16:52:45 -08:00
Rylan Polster
da811373d3 Add named_args DSL for commands 2021-01-13 17:09:42 -05:00
hyuraku
0a97cd18a5 set default args 2020-12-17 21:14:18 +09:00
Markus Reiter
1c2a31e224 Allow passing individual casks to bump-unversioned-casks for debugging. 2020-12-08 01:03:39 +01:00
Bryce Glover
c237223e15 [Library/Homebrew/cli/named_args.rb] to_formulae_to_casks(): Reassociate its
`rescue` block with the right enclosing scope.

     PR #9398 accidentally removed some semantically significant indentation in
this function, thus inadvertently kicking the `rescue` block inside out to func-
tion scope, when it moved its code further up in the file.  This may well not
confuse a Ruby interpreter, but it could trip human readers up.  Compensate and
correct the overlooked offending oversight and potential refactoring mistake by
restoring only that indentation, leaving the function in its new location.

Refs #9398.
2020-12-05 16:34:55 -05:00
Markus Reiter
9649ef975c Only install default cask tap automatically on macOS. 2020-12-05 03:39:01 +01:00
Markus Reiter
e0aa934219 Ensure default cask tap is installed on CaskUnavailableError. 2020-12-05 03:25:58 +01:00
Markus Reiter
fddd589bc3 Make more requires in NamedArgs lazy. 2020-11-30 00:57:36 +01:00
Markus Reiter
1b9002c04a Fix type errors in postinstall. 2020-11-29 21:23:54 +01:00
Markus Reiter
9140b21d80 Support --cask flag in brew info. 2020-11-20 10:36:15 +01:00
Markus Reiter
7dd7d69cd8
Merge pull request #9207 from reitermarkus/brew-zap
Add `--zap` flag for `brew uninstall`.
2020-11-20 09:42:13 +01:00
Markus Reiter
45950bb8ad Support casks in brew edit. 2020-11-20 00:43:15 +01:00
Markus Reiter
bc24128263 Support casks in brew cat. 2020-11-19 16:01:10 +01:00
Markus Reiter
2c47678b05 Add --zap flag to brew uninstall and remove brew zap. 2020-11-19 15:07:59 +01:00
Markus Reiter
f4b4fdac98 Add brew zap command. 2020-11-19 13:42:02 +01:00
Jonathan Chang
a094e43337 cli: fix type signature of to_kegs_to_casks 2020-11-19 21:00:56 +11:00
Markus Reiter
5097af3b74 Support --cask flag in brew uninstall. 2020-11-18 17:30:34 +01:00
Mike McQuaid
f212bf20cb
cli/named_args: don't convert to taps.
Fixes https://github.com/Homebrew/brew/issues/8966
2020-11-17 17:31:30 +00:00
Markus Reiter
3ee66d8c0d Add type annotations related to upgrade. 2020-11-16 19:45:15 +01:00
EricFromCanada
3768b7a6e9 apidoc: update comment wording, punctuation, formatting 2020-11-06 00:21:02 -05:00
Mike McQuaid
60046ac41c
Merge pull request #8893 from whoiswillma/william/integrate-brew-info
cmd/info: Add support for casks in brew info
2020-10-26 11:59:53 +00:00
William Ma
a463348631 cli/named_args: Rename method to be more consistent 2020-10-12 09:22:29 -04:00
William Ma
4c36cf2e8e cmd/info: Add --json=v2 for outputing formula and cask json 2020-10-10 16:34:01 -04:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
William Ma
9a8f4c7c96 cmd/info: Add support for casks 2020-10-09 19:57:48 -04:00
Markus Reiter
e117a68f42 Force brew upgrade to treat arguments as casks if --cask is passed. 2020-10-08 13:43:15 +02:00
Markus Reiter
727d854621 Add missing variable. 2020-10-08 11:07:35 +02:00
Markus Reiter
994e95e356 Refactor usage of NamedArgs in brew install. 2020-10-08 11:07:35 +02:00
Markus Reiter
e40eece17b Add cask options to brew reinstall. 2020-10-08 11:06:04 +02:00
Markus Reiter
5f005f67cf Refactor global Cask::Config. 2020-10-01 00:57:10 +02:00
Markus Reiter
d443afc82d Improve brew man output. 2020-09-27 22:54:57 +02:00
Markus Reiter
f54b458cda Allow installing casks with brew install. 2020-09-27 22:53:32 +02:00
Markus Reiter
37ecdb28f7 Add spec for NamedArgs#to_paths. 2020-09-09 22:15:10 +02:00
Markus Reiter
2a63ba4060 Support passing casks in brew style. 2020-09-09 22:15:10 +02:00
Misty De Meo
c06848c487
Fix printing MultipleVersionsInstalledError details
The refactor in 6e8f5d0958247e4b4d629866099ed2836a0e0863 means that the
exception no longer exposes the name of the package with multiple versions,
and as a result the rescuer is unable to print this information.

Because we now have a path in which MultipleVersionsInstalledError doesn't
have the name at all, we can't reasonably restore the old behaviour.
And since rack resolution happens purely internal to the function that
raises the exception, the caller has no way to know what name to use.
However, since the exception text gets printed anyway, we can just move
this text into the exception itself.

Fixes the following error:

```
Error: mpd has multiple installed versions
Error: undefined method `name' for #<MultipleVersionsInstalledError:0x00007fc6009d8870>
/usr/local/Homebrew/Library/Homebrew/cmd/uninstall.rb:137:in `rescue in uninstall'
/usr/local/Homebrew/Library/Homebrew/cmd/uninstall.rb:135:in `uninstall'
/usr/local/Homebrew/Library/Homebrew/brew.rb:119:in `<main>'
```
2020-09-09 11:56:53 -07:00
Seeker
5acdcd26d0 formula: rename installed_prefix to latest_installed_prefix 2020-09-01 09:32:32 -07:00
Mike McQuaid
344d8432d2 cli/named_args: handle missing cask tap.
Casks (and indeed formulae) don't always have taps.

Fixes #8535
2020-09-01 08:50:56 +01:00
Claudia
7d09ddc3b5
Print meaningful message on missing formula
Add an import statement needed for `MissingFormula` to be found.

Fixes #8538.

Reported-by: Nate Whetsell <nathan.whetsell@gmail.com>
2020-08-30 17:43:54 +02:00
Markus Reiter
46a93ee7bb Don't output warning to stdout. 2020-08-29 20:24:08 +02:00
Mike McQuaid
3866c0b047
Merge pull request #8483 from whoiswillma/print-correct-cask-ref
cli/named_args: Print correct cask ref when name is loaded as formula/keg
2020-08-27 08:39:14 +01:00
Markus Reiter
ceeb6e6492 Document NamedArgs. 2020-08-26 03:13:58 +02:00
William Ma
d32be75ec0 named args: Print correct cask ref when name is resolved as formula/keg 2020-08-25 11:57:01 -04:00