Class: Cask::Cmd::UnknownSubcommand Private

Inherits:
Object
  • Object
show all
Defined in:
brew/Library/Homebrew/cask/cmd.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Helper class for showing help for unknown subcommands.

Instance Method Summary collapse

Constructor Details

#initialize(command_name) ⇒ UnknownSubcommand

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of UnknownSubcommand.



313
314
315
# File 'brew/Library/Homebrew/cask/cmd.rb', line 313

def initialize(command_name)
  @command_name = command_name
end

Instance Method Details

#helpObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



321
322
323
# File 'brew/Library/Homebrew/cask/cmd.rb', line 321

def help
  run
end

#runObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:



317
318
319
# File 'brew/Library/Homebrew/cask/cmd.rb', line 317

def run(*)
  raise UsageError, "Subcommand `#{@command_name}` does not exist."
end