Index: drush/default_content.drush.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- drush/default_content.drush.inc	(revision )
+++ drush/default_content.drush.inc	(revision )
@@ -14,7 +14,8 @@
     'description' => dt('Exports a single entity'),
     'arguments' => [
       'entity_type' => dt('The entity type to export.'),
-      'entity_id' => dt('The ID of the entity to export.'),
+      'property_name' => dt('The property name condition for the entity type to limit entities exported by.'),
+      'property_value' => dt('The property value for the property name condition.'),
     ],
     'options' => [
       'file' => dt('Write out the exported content to a file instead of stdout'),
@@ -72,24 +73,27 @@
  *
  * @param string $entity_type_id
  *   The entity type ID.
- * @param mixed $entity_id
- *   (Optional) The entity ID to export or all entities will be exported.
+ * @param mixed $property_name
+ *   (Optional) The property name of the entity type to load specific entities.
+ * @param mixed $property_value
+ *   (Optional) The value for the property name to load specific entities by.
+ *
  */
-function drush_default_content_export_references($entity_type_id, $entity_id = NULL) {
+function drush_default_content_export_references($entity_type_id, $property_name = FALSE, $property_value = FALSE) {
   /** @var \Drupal\default_content\DefaultContentManagerInterface $manager */
   $manager = \Drupal::service('default_content.manager');
 
+  $properties = $property_name ? [$property_name => $property_value] : [];
+  $entities = \Drupal::entityManager()->getStorage($entity_type_id)->loadByProperties($properties);
+
   $folder = drush_get_option('folder', '.');
-  if (is_null($entity_id)) {
-    $entities = \Drupal::entityQuery($entity_type_id)->execute();
-  }
-  else {
-    $entities = array($entity_id);
-  }
+
   // @todo Add paging.
-  foreach ($entities as $entity_id) {
-    $serialized_by_type = $manager->exportContentWithReferences($entity_type_id, $entity_id);
-    $manager->writeDefaultContent($serialized_by_type, $folder);
+  foreach ($entities as $entity) {
+    if ($entity_id = $entity->id()) {
+      $serialized_by_type = $manager->exportContentWithReferences($entity_type_id, $entity_id);
+      $manager->writeDefaultContent($serialized_by_type, $folder);
+    }
   }
 }
 
