Class: Cask::Cmd::UnknownSubcommand Private

Inherits:
Object
  • Object
show all
Defined in:
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.


242
243
244
# File 'Library/Homebrew/cask/cmd.rb', line 242

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.


250
251
252
# File 'Library/Homebrew/cask/cmd.rb', line 250

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:


246
247
248
# File 'Library/Homebrew/cask/cmd.rb', line 246

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