code: def cleanup_tail(options):
      
  
      if options.kwargs['omode'] == "csv":
          options.kwargs['fd'].write("\n")
      elif options.kwargs['omode'] == "xml":
          options.kwargs['fd'].write("\n</results>\n")
      else:
          options.kwargs['fd'].write("\n]\n")
docs: cleanup the tail of a recovery