You are here

function features_drush_command in Features 8.4

Same name and namespace in other branches
  1. 8.3 drush/features.drush8.inc \features_drush_command()
  2. 6 features.drush.inc \features_drush_command()
  3. 7.2 features.drush.inc \features_drush_command()
  4. 7 features.drush.inc \features_drush_command()

Implements hook_drush_command().

File

drush/features.drush8.inc, line 16
Features module drush integration.

Code

function features_drush_command() {
  $items = [];
  $items['features-status'] = [
    'description' => 'Display current Features settings.',
    'aliases' => [
      'fs',
    ],
  ];
  $items['features-list-packages'] = [
    'description' => 'Display a list of all existing features and packages available to be generated.  If a package name is provided as an argument, then all of the configuration objects assigned to that package will be listed.',
    'examples' => [
      "drush features-list-packages" => 'Display a list of all existing featurea and packages available to be generated.',
      "drush features-list-packages 'example_article'" => "Display a list of all configuration objects assigned to the 'example_article' package.",
    ],
    'arguments' => [
      'package' => 'The package to list. Optional; if specified, lists all configuration objects assigned to that package. If no package is specified, lists all of the features.',
    ],
    'outputformat' => [
      'default' => 'table',
      'pipe-format' => 'list',
      'field-labels' => [
        'name' => 'Name',
        'machine_name' => 'Machine name',
        'status' => 'Status',
        'version' => 'Version',
        'state' => 'State',
        'object' => 'Configuration object',
      ],
      'output-data-type' => 'format-table',
    ],
    'aliases' => [
      'fl',
    ],
  ];
  $items['features-import-all'] = [
    'description' => 'Import module config from all installed features.',
    'examples' => [
      "drush features-import-all" => 'Import module config from all installed features.',
    ],
    'aliases' => [
      'fra',
      'fia',
      'fim-all',
    ],
  ];
  $items['features-export'] = [
    'description' => "Export the configuration on your site into a custom module.",
    'arguments' => [
      'package' => 'A space delimited list of features to export.',
    ],
    'options' => [
      'add-profile' => 'Package features into an install profile.',
    ],
    'examples' => [
      "drush features-export" => 'Export all available packages.',
      "drush features-export example_article example_page" => "Export the example_article and example_page packages.",
      "drush features-export --add-profile" => "Export all available packages and add them to an install profile.",
    ],
    // Add previous "fu" alias for compatibility.
    'aliases' => [
      'fex',
      'fu',
      'fua',
      'fu-all',
    ],
  ];
  $items['features-add'] = [
    'description' => "Add a config item to a feature package.",
    'arguments' => [
      'feature' => 'Feature package to export and add config to.',
      'components' => 'Patterns of config to add, see features-components for the format of patterns.',
    ],
    'aliases' => [
      'fa',
      'fe',
    ],
  ];
  $items['features-components'] = [
    'description' => 'List features components.',
    'arguments' => [
      'patterns' => 'The features components type to list. Omit this argument to list all components.',
    ],
    'options' => [
      'exported' => [
        'description' => 'Show only components that have been exported.',
      ],
      'not-exported' => [
        'description' => 'Show only components that have not been exported.',
      ],
    ],
    'aliases' => [
      'fc',
    ],
  ];
  $items['features-diff'] = [
    'description' => "Show the difference between the active config and the default config stored in a feature package.",
    'arguments' => [
      'feature' => 'The feature in question.',
    ],
    'options' => [
      'ctypes' => 'Comma separated list of component types to limit the output to. Defaults to all types.',
      'lines' => 'Generate diffs with <n> lines of context instead of the usual two.',
    ],
    'aliases' => [
      'fd',
    ],
  ];
  $items['features-import'] = [
    'description' => "Import a module config into your site.",
    'arguments' => [
      'feature' => 'A space delimited list of features or feature:component pairs to import.',
    ],
    'options' => [
      'force' => "Force import even if config is not overridden.",
    ],
    'examples' => [
      'drush features-import foo:node.type.page foo:taxonomy.vocabulary.tags bar' => 'Import node and taxonomy config of feature "foo". Import all config of feature "bar".',
    ],
    'aliases' => [
      'fim',
      'fr',
    ],
  ];
  foreach ($items as $name => &$item) {
    $item['options']['bundle'] = [
      'description' => 'Use a specific bundle namespace.',
    ];
  }
  return $items;
}