lib/landrush/command.rb in landrush-0.16.0 vs lib/landrush/command.rb in landrush-0.17.0

- old
+ new

@@ -7,11 +7,11 @@ end def execute ARGV.shift # flush landrush from ARGV, RExec wants to use it for daemon commands - command = ARGV.first + command = ARGV.first || 'help' if DAEMON_COMMANDS.include?(command) Server.daemonize elsif command == 'dependentvms' || command == 'vms' if DependentVMs.any? @env.ui.info(DependentVMs.list.map { |dvm| " - #{dvm}" }.join("\n")) @@ -23,10 +23,16 @@ Landrush::Store.hosts.each do |key, value| io.puts "#{key}" io.puts "#{value}" end end + elsif command == 'set' + host, ip = ARGV[1,2] + Landrush::Store.hosts.set(host, ip) + elsif command == 'del' || command == 'rm' + key = ARGV[1] + Landrush::Store.hosts.delete(key) elsif command == 'help' @env.ui.info(help) else boom("'#{command}' is not a command") end @@ -53,9 +59,14 @@ control the landrush server daemon list, ls list all DNS entries known to landrush dependentvms, vms list vms currently dependent on the landrush server + set { <host> <ip> | <alias> <host> } + adds the given host-to-ip or alias-to-hostname mapping. + existing host ip addresses will be overwritten + rm, del { <host> | <alias> } + delete the given hostname or alias from the server help you're lookin at it! EOS end