cask/info: send missing args after removing openstruct

This seems like it was a bug before the recent change to remove
OpenStruct from `Homebrew::CLI::Args` but it was failing silently
before. Now we pass the args to the `Cask::Info.info` method so
that when they eventually reach the `Utils::Analytics.output_analytics`
method they are present as expected.

Example error fragment:

```console
$ set -e HOMEBREW_NO_ANALYTICS
$ brew info iterm2 --cask --verbose
==> iterm2: 3.5.10 (auto_updates)
https://iterm2.com/
Installed
/usr/local/Caskroom/iterm2/3.5.4 (91.7MB)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/i/iterm2.rb
==> Name
iTerm2
==> Description
Terminal emulator as alternative to Apple's Terminal app
==> Artifacts
iTerm.app (App)
Error: undefined method `analytics?' for an instance of Homebrew::CLI::Args
/usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:248:in `output_analytics'
/usr/local/Homebrew/Library/Homebrew/utils/analytics.rb:342:in `cask_output'
/usr/local/Homebrew/Library/Homebrew/cask/info.rb:39:in `info'
```
This commit is contained in:
apainintheneck 2024-12-11 23:24:22 -08:00
parent 0bcb7648ce
commit 8bee0555b9
2 changed files with 4 additions and 4 deletions

View File

@ -31,12 +31,12 @@ module Cask
output output
end end
sig { params(cask: Cask).void } sig { params(cask: Cask, args: Homebrew::Cmd::Info::Args).void }
def self.info(cask) def self.info(cask, args:)
puts get_info(cask) puts get_info(cask)
require "utils/analytics" require "utils/analytics"
::Utils::Analytics.cask_output(cask, args: Homebrew::CLI::Args.new) ::Utils::Analytics.cask_output(cask, args:)
end end
sig { params(cask: Cask).returns(String) } sig { params(cask: Cask).returns(String) }

View File

@ -382,7 +382,7 @@ module Homebrew
def info_cask(cask) def info_cask(cask)
require "cask/info" require "cask/info"
Cask::Info.info(cask) Cask::Info.info(cask, args:)
end end
end end
end end