docs: def cli(env, zonefile, dry_run):
      """Import zone based off a BIND zone file."""
  
      manager = SoftLayer.DNSManager(env.client)
      with open(zonefile) as zone_f:
          zone_contents = zone_f.read()
  
      zone, records, bad_lines = parse_zone_details(zone_contents)
  
      env.out("Parsed: zone=%s" % zone)
      for record in records:
          env.out("Parsed: %s" % RECORD_FMT.format(**record))
  
      for line in bad_lines:
          env.out("Unparsed: %s" % line)
  
      if dry_run:
          return
  
      # Find zone id or create the zone if it doesn't exist
      try:
          zone_id = helpers.resolve_id(manager.resolve_ids, zone,
                                       name='zone')
      except exceptions.CLIAbort:
          zone_id = manager.create_zone(zone)['id']
          env.out(click.style("Created: %s" % zone, fg='green'))
  
      # Attempt to create each record
      for record in records:
          try:
              manager.create_record(zone_id,
                                    record['record'],
                                    record['type'],
                                    record['data'],
                                    record['ttl'])
  
              env.out(click.style("Created: %s" % RECORD_FMT.format(**record),
                                  fg='green'))
          except SoftLayer.SoftLayerAPIError as ex:
              env.out(click.style("Failed: %s" % RECORD_FMT.format(**record),
                                  fg='red'))
              env.out(click.style(str(ex), fg='red'))
  
      env.out(click.style("Finished", fg='green'))