    # File lib/chef/knife.rb, line 500
        def bulk_delete(klass, fancy_name, delete_name=nil, list=nil, regex=nil, &block)
          object_list = list ? list : klass.list(true)

          if regex
            to_delete = Hash.new
            object_list.each_key do |object|
              next if regex && object !~ /#{regex}/
              to_delete[object] = object_list[object]
            end
          else
            to_delete = object_list
          end

          output(format_list_for_display(to_delete))

          confirm("Do you really want to delete the above items")

          to_delete.each do |name, object|
            if Kernel.block_given?
              block.call(name, object)
            else
              object.destroy
            end
            output(format_for_display(object)) if config[:print_after]
            self.msg("Deleted #{fancy_name} #{name}")
          end
        end