Class: VagrantAutoDNS::Command::Clear
- Inherits:
-
Object
- Object
- VagrantAutoDNS::Command::Clear
- Defined in:
- lib/vagrant-autodns/commands/clear.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vagrant-autodns/commands/clear.rb', line 14 def execute require_relative '../autodnsdb' opts = OptionParser.new do |optp| optp. = "Usage: vagrant autodns clear" end argv = (opts) || return #Takes no arguments raise Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if (argv.length != 0) if VagrantAutoDNS.autodnsdb.delete_all_records @env.ui.info("DNS cleared") 0 else @env.ui.error("Something went wrong") 1 end end |