class Raykit::Console

def remove

def remove
  if @opts.arguments.length < 2
    puts "remove requires a url or pattern"
    return 1
  end
  pattern = ""
  pattern = @opts.arguments[1] if @opts.arguments.length > 1
  remove_urls = REPOSITORIES.matches(pattern)
  if remove_urls.length.zero?
    puts "no matching urls found."
  else
    remove_urls.each do |url|
      REPOSITORIES.delete(url)
      puts "url #{url} removed."
    end
    REPOSITORIES.save(REPOSITORIES.filename)
  end
end