homebrew-cask-versions/lib/cask/cli/uninstall.rb
Roland Walker b7573b3838 create abstract Cask::CLI::Base
from which all commands inherit.  Add `visible` method
for future use.
2014-06-20 15:06:29 -04:00

16 lines
480 B
Ruby

class Cask::CLI::Uninstall < Cask::CLI::Base
def self.run(*args)
raise CaskUnspecifiedError if args.empty?
cask_names = args.reject { |a| a.chars.first == '-' }
cask_names.each do |cask_name|
odebug "Uninstalling Cask #{cask_name}"
cask = Cask.load(cask_name)
raise CaskNotInstalledError.new(cask) unless cask.installed?
Cask::Installer.new(cask).uninstall
end
end
def self.help
"uninstalls the cask of the given name"
end
end