Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.93k stars 10.71k forks source link

`brew cask --help` results in an internal error #81203

Closed Ontonator closed 4 years ago

Ontonator commented 4 years ago

General troubleshooting steps

Description of issue

brew cask --help generates an internal error complaining about help being undefined, before exiting with an error code of 1.

Command that failed

brew cask --help

Output of command with --force --verbose --debug

Error: undefined method `help' for #<Cask::Cmd::NullCommand:0x00007fbb95d71790>
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:148:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd.rb:92:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:9:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `<main>'

Output of brew cask doctor

==> Homebrew Version
2.2.13-130-gef471e9
==> macOS
10.15.3
==> SIP
Unknown (custom configuration)

configuration:
apple internal: disabled
kext signing: enabled
filesystem protections: enabled
debugging restrictions: disabled
dtrace restrictions: enabled
nvram protections: enabled
basesystem verification: enabled
==> Java
13.0.2, 9.0.1, 1.8.0_202, 1.8.0_121, 1.8.0_112, 1.8.0_92, 1.8.0_60, 1.8.0_45, 1.8.0_25, 1.8.0_20, 1.8.0_11, 1.8.0_05, 1.7.0_55, 1.
7.0_45, 1.7.0_40
==> xattr issues
<NONE>
==> Gatekeeper support
Enabled
==> Homebrew Cask Install Location
<NONE>
==> Homebrew Cask Staging Location
/usr/local/Caskroom
==> Homebrew Cask Taps:
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask (3538 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-fonts (916 casks)
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask-drivers (146 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/ruby-macho-2.2.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-rspec-1.38.1/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rubocop-performance-1.5.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/rexml-3.2.4/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/plist-3.5.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/mechanize-2.7.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/activesupport-6.0.2.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/zeitwerk-2.3.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/tzinfo-1.2.7/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/thread_safe-0.3.6/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/i18n-1.8.2/lib
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/bundler/../ruby/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby
/Library/Ruby/Site/2.6.0
/Library/Ruby/Site/2.6.0/universal-darwin19
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby/2.6.0/universal-darwin19
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin19
/usr/local/Homebrew/Library/Homebrew
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/local/Homebrew/Library/Homebrew/shims/scm:/usr/bin:/bin:/usr/sbin:/sbin"
SHELL="/usr/local/bin/zsh"

Output of brew tap

browsh-org/browsh
homebrew/cask
homebrew/cask-drivers
homebrew/cask-fonts
homebrew/core
homebrew/services
osx-cross/avr
teamookla/speedtest
miccal commented 4 years ago

The command you are looking for is brew cask help, not brew cask --help:

-bash-5.0.16- /Users/miccal (33) [> brew cask help
Homebrew Cask provides a friendly CLI workflow for the administration
of macOS applications distributed as binaries.

Commands:
    --cache    display the file used to cache the Cask
    audit      verifies installability of Casks
    cat        dump raw source of the given Cask to the standard output
    create     creates the given Cask and opens it in an editor
    doctor     checks for configuration issues
    edit       edits the given Cask
    fetch      downloads remote application files to local cache
    help       print help strings for commands
    home       opens the homepage of the given Cask
    info       displays information about the given Cask
    install    installs the given Cask
    list       with no args, lists installed Casks; given installed Casks, lists staged files
    outdated   list the outdated installed Casks
    reinstall  reinstalls the given Cask
    style      checks Cask style using RuboCop
    uninstall  uninstalls the given Cask
    upgrade    upgrades all outdated casks
    zap        zaps all files associated with the given Cask

See also "man brew-cask"

Also see https://github.com/Homebrew/homebrew-cask/issues/78491

Ontonator commented 4 years ago

I am aware of that. However, brew cask --help should display a more helpful message instead of running into an internal error. For reference, the output of brew cask --asdf is:

Error: Unknown subcommand: --asdf

Commands:
    --cache    display the file used to cache the Cask
    audit      verifies installability of Casks
    cat        dump raw source of the given Cask to the standard output
    create     creates the given Cask and opens it in an editor
    doctor     checks for configuration issues
    edit       edits the given Cask
    fetch      downloads remote application files to local cache
    help       print help strings for commands
    home       opens the homepage of the given Cask
    info       displays information about the given Cask
    install    installs the given Cask
    list       with no args, lists installed Casks; given installed Casks, lists staged files
    outdated   list the outdated installed Casks
    reinstall  reinstalls the given Cask
    style      checks Cask style using RuboCop
    uninstall  uninstalls the given Cask
    upgrade    upgrades all outdated casks
    zap        zaps all files associated with the given Cask

See also "man brew-cask"
vitorgalvao commented 4 years ago

I agree this shouldn’t be an error, but it’s fixed by https://github.com/Homebrew/homebrew-cask/issues/78491 so no need for two issues.